4 ms·
It ensures that a variable is declared in the current scope. That's the easy to explain meaning. It's inconsistent with other languages which introduce a new s
by inimino 10y ago
It ensures that a variable is declared in the current scope. That's the easy to explain meaning.
It's inconsistent with other languages which introduce a new scope whenever there are curly braces, but there's nothing inconsistent about the syntax. That's just a matter of taking expectations from other languages and expecting them to work unchanged in JavaScript.