Is there a library which implements new Javascript

2019-04-22 00:48发布

Although Ecmascript 5 introduces some completely new features, it also adds some new methods (bind, trim, map, etc.) which should be perfectly possible to implement (albeit slower) in current versions. Does a library exist which implements these backwards compatible features (and no more, excluding Prototype et. al.)

4条回答
ゆ 、 Hurt°
2楼-- · 2019-04-22 01:28

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.

查看更多
老娘就宠你
3楼-- · 2019-04-22 01:29

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.

查看更多
Evening l夕情丶
4楼-- · 2019-04-22 01:29

So, I just gave up and started an ES5 library

查看更多
一纸荒年 Trace。
5楼-- · 2019-04-22 01:51

Prototype and Underscore implement a lot of those.

查看更多
登录 后发表回答