Is there a library which implements new Javascript/Ecmascript 5 methods for older versions?

对着背影说爱祢 提交于 2019-12-05 02:22:10

Kris Kowal and friends have built the es5-shim. It was part of Narwhal, but now lives on its own:

http://github.com/kriskowal/es5-shim/

Was: I've taken to using the global-es5.js shim from narwhal:

http://github.com/280north/narwhal/blob/master/engines/default/lib/global-es5.js

you'll have to take out the require("json"); line at the bottom, but other than that, it should be browser-clean.

Prototype and Underscore implement a lot of those.

So, I just gave up and started an ES5 library

You might want to check out pulpjs. You can pick the pieces you want to include, and then grab the protocompat module, which will make a bunch of methods available as extensions on the object prototypes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!