Expert Developer JavaScript Question:

What is Strict Mode in JavaScript?

Tweet Share WhatsApp

Answer:

► The fifth edition of ECMAScript specification has introduced Script Mode.
► Strict Mode applies a layer of constraint on JavaScript.
► It throws errors for actions that are problematic and didn't throw an error before.
► It throws errors for the actions which are potentially unsafe.
► It shut downs the functions which are poorly thought out.
► Strict mode solves mistakes that are responsible for the difficulty of JavaScript engines to perform optimizations.
► To enable the strict mode we have to add the string literal "use strict" on the top of file or function as follow :
function myfunction()
{
"use strict";
var v = "I am a strict mode function";
}

Download Expert JavaScript Developer PDF Read All 150 Expert JavaScript Developer Questions
Previous QuestionNext Question
What are Math Constants and Functions using JavaScript?What is the difference between window.onload and the jQuery $(document).ready() method?