3 ms·
JavaScript is different in that it use the function as the lexical scope rather then the angel brackets. This forces you to think about the code as functions, r
by z3t4 5y ago
JavaScript is different in that it use the function as the lexical scope rather then the angel brackets. This forces you to think about the code as functions, rather then blocks. And in turn helps you think of the code in three dimensions where time is one dimension, making it easier to understand code that runs asynchronously.
- z3t4 5y agoBecause people coming from other languages find this confusing the let (and const) keyword was specified (ES6/2015) for block/angel-bracket lexical scope. Whereas var is function scoped.