Can someone explain why first function is running not the second one when I call it?
{
function a() {
console.log('first function')
}
}
function a() {
console.log('second function')
}
a()
If we declare them in a global scope they behave as expected, but inside block scope it's completely different. Why?
function a() {
console.log('first function')
}
function a() {
console.log('second function')
}
a()