JS - What Is Use Strict and What Does It Do
Posted

The keyword ‘use strict’ means that the JavaScript engine will be pickier about certain things we do when we write code.
It turns on the strict mode operating context wherever you place it (inside of a function will activate strict mode on the function level scope) including:
- Using a variable before it’s defined now causes an error.
- It stops you from using words that are reserved for future versions of JS.
- You cannot delete functions, variables or functions arguments in “use strict” mode
- Makes eval a bit safer to use (doesn’t let variables escape)
- So, in strict mode, if this was not defined by the execution context, it remains undefined.