FrontendDeveloper.in

JavaScript question detail

What is a strict mode in javascript

JavaScript’s "use strict" directive is used to opt into a stricter parsing and error-handling mode for your scripts or functions. It helps catch common bugs, makes your code more secure, and prepares it for future versions of JavaScript.

Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a “strict” operating context. This way it prevents certain actions from being taken and throws more exceptions. The literal expression "use strict"; instructs the browser to use the javascript code in the Strict mode. This also enables block-scoped variables.

Back to all JavaScript questions
Get LinkedIn Premium at Rs 399