LockerService implicitly enables JavaScript ES5 strict mode. You don’t need to specify
"use strict" in your code. JavaScript strict mode
makes code more robust and supportable. For example, it throws some errors that would otherwise
be suppressed.
A few common stumbling points when using strict mode are:
- You must declare variables with the var
keyword.
- You must explicitly attach a variable to the window object to make the variable available outside a library.
For more information, see Sharing JavaScript Code Across Components.
- The libraries that your components use must also work in strict mode.
For more information about JavaScript strict mode, see the Mozilla Developer Network.