underscore.js

Underscore 一个非常实用的JavaScript库,提供许多编程功能的支持,就像你期望 Prototype.js (或者 Ruby), 有这些功能且不扩展任何JavaScript的原生对象

使用起来非常方便。 在FireBug里

var o = [1,2,3];
console.log(_.select(o,function(n){
 return n % 2 !== 0
}));
// output : [1,3]
underscore.js对于想用JavaScript实践Functional Programming的同学非常实用。 以后会大力使用它。
原文地址:https://www.cnblogs.com/buhaiqing/p/2769765.html