4 ms·
Indeed, in the past there was "use strict"; to enable language improvements in ES5. This type of string-command is a no-op command if the implementation
by LukeShu 9y ago
Indeed, in the past there was
"use strict";
to enable language improvements in ES5. This type of string-command is a no-op command if the implementation doesn't recognize the string as special; you put the string-command in there to opt-in to any breaking changes, and then feature-detect to see if things are there in case you're running on an older implementation without those changes.
User hrajchert suggested putting this change behind `"use es2019";`. However, in this case that would be tricky, as the change isn't in language semantics, but in the standard library's Array type. If there are multiple scripts on a page that interact, some of which "use es2019" and some of which don't, how do you handle an array being passed between them?
- deleted 9y ago[deleted]