Summary

  • The modern mode, use strict adds new features to the JavaScript language and modified some of the existing ones (this may break old code).

  • The special directive "use strict" or 'use strict' has to be explicitly placed at the top of a script to enable this modern mode (only comments can be above it).

  • When "use strict" is located at the top of a script, the whole strict works in a modern fashion.

  • Put "use strict" at the beginning of a function enables strict mode in that function only.

  • Advanced language structures like classes and modules enable use strict automatically

  • Advanced language structures like classes and modules enable "use strict" automatically.

References