+ 3
'use strict' in javascript
What is difference ? and why this ?
1 Réponse
+ 4
"use strict"; Defines that JavaScript code should be executed in "strict mode".
Declaring Strict Mode
Strict mode is declared by adding "use strict"; to the beginning of a script or a function.
Declared at the beginning of a script, it has global scope (all code in the script will execute in strict mode):
Example
"use strict";
x = 3.14; // This will cause an error because x is not declared
CREDIT - https://www.w3schools.com/js/js_strict.asp
This website will help you - https://www.w3schools.com/js/js_strict.asp