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
2 comments:
Good you mentioned about it, because is definitely time to start using some nice features of EcmaScript 5. Btw, there is more solutions similar to es5-shim. One of them could be ddr-ecma5 (http://code.google.com/p/ddr-ecma5/).
I think the origin of the Date logic dantman used was actually from here: http://frugalcoder.us/post/2010/01/07/EcmaScript-5s-Date-Extensions.aspx
Though it's been cleaned up a bit by dantman. :)
Post a Comment