What’s the current best practices for the use of 'use strict';
?
What it is
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
- http://stackoverflow.com/questions/1335851/what-does-use-strict-do-in-javascript-and-what-is-the-reasoning-behind-it
Style guide:
Here’s a few projects that use it:
- https://github.com/facebook/react/
- https://github.com/facebook/flux/
- https://github.com/kriasoft/react-starter-kit
Here’s a few that don’t:
While it seems odd to have to put it in every module, it seems to be a “best practice”.
And if you’re using WebPack, there’s now a loader to insert this into every file: strict-loader.
So does it make sense to just use this loader? Any downside?