3 ms·
According to the documentation on MDN[0], it's a part of "early errors" and you should rather but the "use strict" outside the function instead of on the inside
by diggan 10y ago
According to the documentation on MDN[0], it's a part of "early errors" and you should rather but the "use strict" outside the function instead of on the inside. I'm not entirely sure of why the spec wants it to be outside rather than inside though...
- [0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Strict_Non_Simple_Params https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- tomatsu 10y ago> you should rather [put] the "use strict" outside the function instead of on the inside. Modules and classes are always in strict mode. In practice, it really isn't an issue.