News for hackers. Stuff that matters.
Re:Modern Javascript: Everything you missed over the last 10... by z3t4 on Saturday May 15, 2021 @02:46PM (#27167807)
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.
Re:Modern Javascript: Everything you missed over the last 10... by z3t4 on Sunday May 16, 2021 @05:21AM (#27172400)
Because 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.