What is Strict Mode in JavaScript?
Submitted by: Administrator► 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";
}
Submitted by:
► 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";
}
Submitted by:
Read Online Expert Developer JavaScript Job Interview Questions And Answers
Top Expert Developer JavaScript Questions
☺ | Mention what is the disadvantage of using innerHTML in JavaScript? |
☺ | Which keyword is used to print the text in the screen? |
☺ | Why it is not advised to use innerHTML in JavaScript? |
☺ | Explain the concept of unobtrusive JavaScript? |
☺ | How are JavaScript and ECMA Script related? |
Top Scripting language Categories
☺ | AngularJS Interview Questions. |
☺ | Ext-JS Interview Questions. |
☺ | Dojo Interview Questions. |
☺ | Expert Developer JavaScript Interview Questions. |
☺ | jQuery Mobile Interview Questions. |