3 ms·
Yes, as several people have mentioned, I should have said block scope. JS does allow for blocks, but they don't work the way the parent was thinking. You can t
by nfriedly 16y ago
Yes, as several people have mentioned, I should have said block scope. JS does allow for blocks, but they don't work the way the parent was thinking.
You can toss extra curly braces in the code and it is a "block" but unless they are preceded by an "if", "for", or something similar, they don't do much. They do not return values and they do not affect variable scope. Functions do both, hence my last example.