Open sohilpandya opened 6 years ago
Where should I use 'use strict';?
In my new JavaScript application: Absolutely! Strict mode can be used as a whistleblower when you are doing something stupid with your code. In my existing JavaScript code: Probably not! If your existing JavaScript code has statements that are prohibited in strict-mode, the application will simply break. If you want strict mode, you should be prepared to debug and correct your existing code. This is why using 'use strict'; does not suddenly make your code better. link
We have a single file
passwordModule.js
where we are usinguse strict
, What is the reason for using this just in this file?We should be consistent across the board so something worth thinking about.