Comment on Hide this in your coworkers' JavaScript code tomorrowparentComments−brianchu12yI'm not too sure either. In JS, block scoping does not exist. There are only function scopes, so the var declaration gets hoisted out of the if block (but the assignment occurs in the if block - so the assignment doesn't happen).−chewxy12yOh you can definitely fake block scoping in JavaScript, with ES5. ;P
Comments
I'm not too sure either. In JS, block scoping does not exist. There are only function scopes, so the var declaration gets hoisted out of the if block (but the assignment occurs in the if block - so the assignment doesn't happen).
Oh you can definitely fake block scoping in JavaScript, with ES5. ;P