2011-02-07

es5-shim: use ECMAScript 5 in older browsers

ECMAScript 5 (ES5) brings with it some nice improvements. The only problem is that only newer browsers (Internet Explorer 9, Firefox 4, Chrome 5, Safari 5) support it, or at least its most interesting parts. es5-shim provides a neat solution: It checks for each ES5 feature whether it is present and if not, it provides its own implementation. As an aside: es5-shim originated as a Narwhal module and was then turned into a stand-alone library, to encourage broader adoption. es5-shim is the more current version of the two.

Tip: Use the ECMAScript 5 compatibility table to find out whether you need the shim or not. When in doubt, just include it, as it auto-detects whether your browser is too old or not.

Flattr

No comments: