What is the use of strict mode in Javascript.

The “Use strict ” directive was new in ECMAScript version 5. The purpose of use strict mode in javascript is to indicate that the code should be executed in “strict mode”. For a long time, Javascript was evolving without compatibility issues.

“use strict”

When it located on the top of the javascript code then the whole script works the “modern” way. Ensure that “use strict” is at the top of the script, otherwise, the strict mode may not be enabled. Once the enter strict mode there is no directive “no use strict” or alike, that would return the old behavior.

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *