5 ms·
To some extent there is, in that the javascript VMs can treat certain sorts of scopes (like Modules) differently because they know that those did not exist at a
by dangoor 9y ago
To some extent there is, in that the javascript VMs can treat certain sorts of scopes (like Modules) differently because they know that those did not exist at an earlier time when certain bad behaviors were common.
They debated quite a bit while working on ES6 about having a different script type to make more breaking changes, but they decided that this would be bad for evolution on the web (see the adoption of Python 3, for example)
- paulddraper 9y agoTo expand: use strict is always in force in ES6.
- gsnedders 9y agoIn ES6 modules, it is. In other code, ES6 is backwards compatible with ES5 (i.e., code is strict mode iff there's a "strict mode" declaration).
- paulddraper 9y agoOops. Left off that key word :) Yes, ES6 modules.
- nailer 9y agoThat's not correct: a small percentage of the JS community (maybe <1%) use TC39 modules (which enforce strict mode) vs just using npm.
- lexicality 9y agoIn node perhaps. They're extremely common in the front end world - all the fancy SPA frameworks and build systems promote & use them extensively.
- paulddraper 9y agoI am correct because I'm talking about ECMAScript 6. http://www.ecma-international.org/ecma-262/6.0/ http://www.ecma-international.org/ecma-262/6.0/ If you're talking about Node.js or JScript or something else, then that's different.