If we declare a variable and a function with same name, it is accepting re-declaration. But when we do the same thing inside a block, it shows re-declaration error.
Code:
var x;
function x() {}; // no error.
But in this case i'm getting Error.
{
var inside; // re-declaration error.
function inside() {};
}
expected result should be no error.
While exploring this further I came across this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError
The funny thing is that my result is different than theirs for this situation:
Result: