Home javascript use strict need to write or not?

use strict need to write or not? [Duplicate]

Author

Date

Category

Use Strict should be specified at the beginning of the code to enable the strict mode writes in the documentation. Is it necessary for strict mode only when using ECMA SCRIPT 5? He identifies that we write ECMA SCRIPT 5? Please explain i’m confused)


Answer 1, Authority 100%

Yes, you need to use 'use strict'; for scripts written in ES5 and newer.

This is an indication of the browser that you need to parse and execute a script on more modern rules, and which attempts to fix some architectural jackets JS.

If I’m not mistaken, in Served JS environments, it is possible to specify it through the arguments of the command line. You can also write it at the file level. But for browsers it makes sense to write it at the level of the self-saying function-module.

More in the question What does” use STRICT “mean?

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions