Strict Mode Support
by Leo Lanese
HTML
<!--
ECMAScript 5's strict mode is a way to opt in to a restricted variant of JavaScript.
- Throws errors for actions that are rather silly but previously didn’t throw an error
- Throws errors for potentially unsafe actions
- Disables functions that are poorly thought out
- Potentially code in strict mode could run faster by eliminating mistakes that would make it difficult for JavaScript engines to perform optimizations
-->
JavaScript
var isStrictModeSupported = (function(){"use strict";return !this}());
alert(isStrictModeSupported);
/* function to try strict mode example */