热门关键字:
jquery > jquery教程 > 前端框架 > Underscore.js

Underscore.js

1602
作者:管理员
发布时间:2015/6/26 10:05:35
评论数:0
转载请自觉注明原文:http://www.jq-school.com/Show.aspx?id=675

Underscore.js

什么是Underscore

Underscore 是一个 JavaScript 工具库,它提供了一整套函数式编程的实用功能,但是没有扩展任何 JavaScript 内置对象。 他解决了这个问题:“如果我面对一个空白的 HTML 页面,并希望立即开始工作,我需要什么?” 他弥补了 jQuery 没有实现的功能,同时又是 Backbone 必不可少的部分。

Underscore提供了100多个函数:
集合(Collections)
- each
- map
- reduce
- reduceRight
- find
- filter
- where
- findWhere
- reject
- every
- some
- contains
- invoke
- pluck
- max
- min
- sortBy
- groupBy
- indexBy
- countBy
- shuffle
- sample
- toArray
- size
- partition


数组(Arrays)
- first
- initial
- last
- rest
- compact
- flatten
- without
- union
- intersection
- difference
- uniq
- zip
- object
- indexOf
- lastIndexOf
- sortedIndex
- range


函数(Functions)
- bind
- bindAll
- partial
- memoize
- delay
- defer
- throttle
- debounce
- once
- after
- before
- wrap
- negate
- compose


对象(Objects)
- keys
- values
- pairs
- invert
- functions
- extend
- pick
- omit
- defaults
- clone
- tap
- has
- matches
- property
- isEqual
- isEmpty
- isElement
- isArray
- isObject
- isArguments
- isFunction
- isString
- isNumber
- isFinite
- isBoolean
- isDate
- isRegExp
- isNaN
- isNull
- isUndefined


工具函数(Utility)
- noConflict
- identity
- constant
- noop
- times
- random
- mixin
- iteratee
- uniqueId
- escape
- unescape
- result
- now
- template


链式语法(Chaining)
- chain
- value






如果您觉得本文的内容对您的学习有所帮助:支付鼓励



关键字:Underscore.js Underscore JavaScript jQuery Backbone
友荐云推荐