Message from JavaScript discussions

May 2017

— And, if so, how long have you been working like this?


From stackoverflow: ""use strict" applies only to function or program scope. So if you have fileA.js with "use strict" at the top, fileA.js executes in strict mode, and all functions defined in it will do the same when called"

— I assumed as much but had never checked before I saw your musing about it, haha

— It appears this is how it normally is, EXCEPT in cases with complex arguments

— I assume that syntax needs the arguments object, which doesn't exist in strict mode

— However, simply removing complex args made the functions strict mode instantly

— Be warned! Functions that:
1. Have default parameters ( function (a = 1) { )
2. Have destructuring ( function ({ a }) { )
3. Have spread operators ( function (...a) { )

can never be strict mode functions (also applies to arrow functions)

Message permanent page

— Https://

— Use strict will TRY to inherit to child functions, but will fail silently and turn them into non-strict functions for these cases

Message permanent page

— Admin might want to remove this.

— Yup

— I don't think that's neccesarily the case