4 ms·
Variable shadowing sounds like a hacky way to solve problems caused by function scoping, which is solved in ES6 by introducing lexical scoping (i.e. the same sc
by vcarl 12y ago
Variable shadowing sounds like a hacky way to solve problems caused by function scoping, which is solved in ES6 by introducing lexical scoping (i.e. the same scoping rules as in every other language).
It's also worth pointing out that CS and ES6 aren't really comparable technologies. ES6 isn't some newfangled preprocessor that simplifies syntax, it's an update to the standard which JS adheres to. CS is fundamentally limited because it compiles to ES5.1. When ES6 is implemented in browsers, CS will be able to do more.
- yblu 12y ago>> which is solved in ES6 by introducing lexical scoping I thought JS has always had lexical scoping. What's new in ES6 allowing variables to have block scope.