FAC-11 / AllAboutMe

An app to help young people at Anna Freud centre to easily transition to adult care
https://allaboutme-af.herokuapp.com/
10 stars 6 forks source link

Usage of `use strict` #176

Open sohilpandya opened 6 years ago

sohilpandya commented 6 years ago

We have a single file passwordModule.js where we are using use strict, What is the reason for using this just in this file?

We should be consistent across the board so something worth thinking about.

polyccon commented 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