JavaScript Strict Mode
JavaScript's strict mode, introduced in ECMAScript 5, is a way to opt-in to a restricted variant of JavaScript, thereby implicitly opting-out of "sloppy mode". Strict mode isn't just a subset: it intentionally has different semantics from normal code. Strict mode implements several changes to normal JS code semantics: 1. Eliminates some JavaScript silent errors by changing them to throw errors. 2. Fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that's not strict mode. 3. Prohibits some syntax likely to be defined in future versions of ECMAScript How does one go about invoking strict mode in their code? There are several places you can do this and these include in functions, for whole scripts and since ECMAScript 2015, in modules. To invoke strict mode in functions, simply add 'use strict'; OR "use strict"; to the beg...