Strict in JS code example
Example 1: javascript use strict
// Whole-Script Strict Mode Syntax
'use strict';
var v = "Hi! I'm a strict mode script!";
Example 2: use strict javascript
function doSomething() {
'use strict';
...
}
Example 3: Turn on modern JS by adding use strict to your script
// Non-strict code...
(function(){
"use strict";
// Define your library strictly...
})();
// Non-strict code...