Using strict mode in Javascript
‘use strict’ is a rather useful statement to have at the beginning of all Javascript modules or functions. It ensures that all code in the module is executed in strict mode. The usage is simple enough. "use strict"; // lot of code You can also enable strict mode to specific functions. function getSum(x, y) { "use strict"; return x + y; } Strict mode has to be at the beginning of files or modules - will not have the desired effect if used anywhere else. ...