What does "use strict" mean in JavaScript?
Mary

Mary @piperymary

About: I'm a marketing specialist at ExceedTeam, software development company based in Russia. Interested in tech, web-development, fitness.

Location:
Russia
Joined:
Oct 30, 2020

What does "use strict" mean in JavaScript?

Publish Date: Nov 25 '20
8 0

The "use strict" in your JavaScript code turns on strict mode. (Or does nothing, in pre-fifth ECMAScript implementations). This directive applies to the scope in which it is specified.
Examples of using
// file: ok.js
"use strict"; // affects the whole file
alert ("ok");
(function () {
"use strict"; // valid only within the function
alert ("ok");
} ());

To learn why you need this mode in your coding, read the article to the end.

Comments 0 total

    Add comment