Using Strict mode

So I recently heard an advice to use JavaScript strict mode all the time and that this is the best practice and I wonder, do you guys use it? If so, do you use it all the time, everywhere or occasionally in some parts of code?

1 Like

Good question, dude! I was wondering the same thing.

Strict mode is a great idea for a few technical reasons. For now, just know that you cannot go wrong by using it, and it will very probably save you from yourself at some point.

2 Likes

Its a good practice to always use it. It will prevent you from doing some egregious mistakes like forgetting to use the var keyword inside a function with a variable declaration and then having the variable hoisted outside the function to the global scope.

1 Like