java-script:strict-mode
This is an old revision of the document!
Strict mode
The “use strict” directive in JavaScript was introduced in ES5 to help you catch common coding mistakes and “unsafe” actions like assigning values to read-only variables or using some of the reserved keywords.
When you put “use strict” at the top of your JavaScript code or function, the JavaScript interpreter will switch to the Strict Mode, and it will start to catch and throw errors for actions that would be ignored or would fail silently in normal, non-strict code.
Examples:
"use strict"; x = 3.14; // This will throw an error because x is not declared.
java-script/strict-mode.1690304654.txt.gz · Last modified: 2023/07/25 20:04 by odefta