# lodash
一個 JavaScript 的實用工具庫, 表現一致性, [模塊化](https://www.npmjs.com/browse/keyword/lodash-modularized), 高性能, 以及 [可擴展](#features)
### Example
```
_.assign({ 'a': 1 }, { 'b': 2 }, { 'c': 3 });
// → { 'a': 1, 'b': 2, 'c': 3 }
_.map([1, 2, 3], function(n) { return n * 3; });
// → [3, 6, 9]
```
## 特點
* ~100% [代碼覆蓋率](https://coveralls.io/github/lodash)
* 遵循 [語義化版本控制規范](http://semver.org/)
* [延遲計算鏈](http://filimanjaro.com/blog/2014/introducing-lazy-evaluation/)
* [_(…)](./_) 支持隱式鏈
* [_.ary](./ary) & [_.rearg](./rearg) 改變函數的實參個數和順序
* [_.at](./at) 更方便的獲取數組或對象的值
* [_.attempt](./attempt) 無需 try-catch 來處理可能會出錯的執行函數
* [_.before](./before) 與 [_.after](./after) 互補
* [_.bindKey](./bindKey) 實現 [_“懶傳參”_](http://michaux.ca/articles/lazy-function-definition-pattern)
* [_.chunk](./chunk) 按給定個數來拆分數組
* [_.clone](./clone) 支持對 `Date` & `RegExp` 對象的淺拷貝
* [_.cloneDeep](./cloneDeep) 深拷貝數組或對象
* [_.curry](./curry) & [_.curryRight](./curryRight) 用于創建 [柯里化](http://hughfdjackson.com/javascript/why-curry-helps/) 函數
* [_.debounce](./debounce) & [_.throttle](./throttle) 處理函數防抖和節流
* [_.defaultsDeep](./defaultsDeep) 深分配對象的可枚舉屬性
* [_.fill](./fill) 指定值填充數組
* [_.findKey](./findKey) 按 keys 查找對象
* [_.flow](./flow) 與 [_.flowRight](./flowRight) (即 `_.compose`) 搭配
* [_.forEach](./forEach) 支持提前中斷
* [_.forIn](./forIn) 遍歷對象所有的可枚舉屬性
* [_.forOwn](./forOwn) 遍歷對象的所有屬性
* [_.get](./get) & [_.set](./set) 以 path 的方式獲取和設置對象屬性
* [_.gt](./gt), [_.gte](./gte), [_.lt](./lt), & [_.lte](./lte) 關系比較方法
* [_.inRange](./inRange) 檢測給定的數值是否在指定范圍內
* [_.isNative](./isNative) 檢測是否是原生函數
* [_.isPlainObject](./isPlainObject) & [_.toPlainObject](./toPlainObject) 檢測是否是普通對象以及轉換為普通對象
* [_.isTypedArray](./isTypedArray) 檢測是否是類型數組
* [_.mapKeys](./mapKeys) 按對象的 key 迭代,并返回新 key 的對象
* [_.matches](./matches) 支持深匹配對象
* [_.matchesProperty](./matchesProperty) & [_.matches](./matches) & [_.property](./property) 互補
* [_.merge](./merge) 相當于遞歸版 [_.extend](./extend)
* [_.method](./method) & [_.methodOf](./methodOf) 創建一個調用方法的函數
* [_.modArgs](./modArgs) 更高級的功能組合
* [_.parseInt](./parseInt) 兼容各環境
* [_.pull](./pull), [_.pullAt](./pullAt), & [_.remove](./remove) 方便調整數組
* [_.random](./random) 支持返回浮點數
* [_.restParam](./restParam) & [_.spread](./spread) 應用一個 rest arguments 和 Spread operator 參數傳遞給函數
* [_.runInContext](./runInContext) 無影響的 mixins 且更方便模擬
* [_.slice](./slice) 支持裁剪類數組
* [_.sortByAll](./sortByAll) & [_.sortByOrder](./sortByOrder) 多個屬性排序
* [_.support](./support) 標記環境功能
* [_.template](./template) 支持 [_“imports”_](./templateSettings-imports) 方式 & [ES 字符串模板](http://people.mozilla.org/%7Ejorendorff/es6-draft.html#sec-template-literal-lexical-components)
* [_.transform](./transform) 更強大的 [_.reduce](./reduce) 代替方法
* [_.unzipWith](./unzipWith) & [_.zipWith](./zipWith) 指定如何重組分解后的數組
* [_.valuesIn](./valuesIn) 獲取所有可枚舉屬性的值
* [_.xor](./xor) & [_.difference](./difference), [_.intersection](./intersection), & [_.union](./union) 互補
* [_.add](./add), [_.round](./round), [_.sum](./sum), [及更多](./doc "_.ceil, _.floor") 數學方法
* [_.bind](./bind), [_.curry](./curry), [_.partial](./partial), & [及更多](./docs "_.bindKey, _.curryRight, _.partialRight") 支持自定參數占位
* [_.capitalize](./capitalize), [_.trim](./trim), & [及更多](./docs "_.camelCase, _.deburr, _.endsWith, _.escapeRegExp, _.kebabCase, _.pad, _.padLeft, _.padRight, _.repeat, _.snakeCase, _.startsWith, _.trimLeft, _.trimRight, _.trunc, _.words") string 方法
* [_.clone](./clone), [_.isEqual](./isEqual), & [及更多](./docs "_.assign, _.cloneDeep, _.merge") 接受自定回調函數
* [_.dropWhile](./dropWhile), [_.takeWhile](./takeWhile), & [及更多](./docs "_.drop, _.dropRight, _.dropRightWhile, _.take, _.takeRight, _.takeRightWhile") 互補 [_.first](./first), [_.initial](./initial), [_.last](./last), & [_.rest](./rest)
* [_.findLast](./findLast), [_.findLastKey](./findLastKey), & [及更多](./docs "_.curryRight, _.dropRight, _.dropRightWhile, _.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.padRight, partialRight, _.takeRight, _.trimRight, _.takeRightWhile") 右結合方法
* [_.includes](./includes), [_.toArray](./toArray), & [及更多](./docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.findWhere, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.sortByAll, _.sortByOrder, _.sum, _.where") 接受字符串方式
* [_#commit](./prototype-commit) & [_#plant](./prototype-plant) 配合鏈式隊列
* [_#thru](./thru) 傳遞鏈式隊列的值
## 關于翻譯
* 該文檔由 [think2011](https://github.com/think2011/) 翻譯,遵循 [MIT協議](https://github.com/jldec/lodash-doc-src/blob/master/LICENSE), 定時保持與官方同步,翻譯質量可能沒法特別好,但會保證盡可能反復細心。
* 如果您有任何建議,或者意見,[歡迎在此討論,及時更正 ;-)](https://github.com/think2011/lodash-zh/issues)。
- 主頁
- 入門指南
- 下載
- 引入
- 模塊格式
- 深入了解
- 兼容性
- 版本定制
- Array
- chunk
- compact
- concat
- difference
- differenceBy
- differenceWith
- drop
- dropRight
- dropRightWhile
- dropWhile
- fill
- findIndex
- findLastIndex
- flatten
- flattenDeep
- flattenDepth
- fromPairs
- head first
- indexOf
- initial
- intersection
- intersectionBy
- intersectionWith
- join
- last
- lastIndexOf
- prototype.reverse
- pull
- pullAll
- pullAllBy
- pullAt
- remove
- slice
- sortedIndex
- sortedIndexBy
- sortedIndexOf
- sortedLastIndex
- sortedLastIndexBy
- sortedLastIndexOf
- sortedUniq
- sortedUniqBy
- tail
- take
- takeRight
- takeRightWhile
- takeWhile
- union
- unionBy
- unionWith
- uniq
- uniqBy
- uniqWith
- unzip
- unzipWith
- without
- xor
- xorBy
- xorWith
- zip
- zipObject
- zipObjectDeep
- zipWith
- Collection
- countBy
- every
- filter
- find
- findLast
- flatMap
- forEach each
- forEachRight eachRight
- groupBy
- includes
- invokeMap
- keyBy
- map
- orderBy
- partition
- reduce
- reduceRight
- reject
- sample
- sampleSize
- shuffle
- size
- some
- sortBy
- Date
- now
- Function
- after
- ary
- before
- bind
- bindKey
- curry
- curryRight
- debounce
- defer
- delay
- flip
- memoize
- negate
- once
- overArgs
- partial
- partialRight
- rearg
- rest
- spread
- throttle
- unary
- wrap
- Lang
- castArray
- clone
- cloneDeep
- cloneDeepWith
- cloneWith
- eq
- gt
- gte
- isArguments
- isArray
- isArrayBuffer
- isArrayLike
- isArrayLikeObject
- isBoolean
- isBuffer
- isDate
- isElement
- isEmpty
- isEqual
- isEqualWith
- isError
- isFinite
- isFunction
- isInteger
- isLength
- isMap
- isMatch
- isMatchWith
- isNaN
- isNative
- isNil
- isNull
- isNumber
- isObject
- isObjectLike
- isPlainObject
- isRegExp
- isSafeInteger
- isSet
- isString
- isSymbol
- isTypedArray
- isUndefined
- isWeakMap
- isWeakSet
- lt
- lte
- toArray
- toInteger
- toLength
- toNumber
- toPlainObject
- toSafeInteger
- toString
- Math
- add
- ceil
- floor
- max
- maxBy
- mean
- min
- minBy
- round
- subtract
- sum
- sumBy
- Methods
- templateSettings.imports._
- Number
- clamp
- inRange
- random
- Object
- assign
- assignIn extend
- assignInWith extendWith
- assignWith
- at
- create
- defaults
- defaultsDeep
- findKey
- findLastKey
- forIn
- forInRight
- forOwn
- forOwnRight
- functions
- functionsIn
- get
- has
- hasIn
- invert
- invertBy
- invoke
- keys
- keysIn
- mapKeys
- mapValues
- merge
- mergeWith
- omit
- omitBy
- pick
- pickBy
- result
- set
- setWith
- toPairs
- toPairsIn
- transform
- unset
- values
- valuesIn
- Properties
- templateSettings
- templateSettings.escape
- templateSettings.evaluate
- templateSettings.imports
- templateSettings.interpolate
- templateSettings.variable
- VERSION
- Seq
- _
- chain
- prototype.at
- prototype.chain
- prototype.commit
- prototype.next
- prototype.plant
- prototype.Symbol.iterator
- prototype.value run, toJSON, valueOf
- tap
- thru
- wrapperFlatMap
- String
- camelCase
- capitalize
- deburr
- endsWith
- escape
- escapeRegExp
- kebabCase
- lowerCase
- lowerFirst
- pad
- padEnd
- padStart
- parseInt
- repeat
- replace
- snakeCase
- split
- startCase
- startsWith
- template
- toLower
- toUpper
- trim
- trimEnd
- trimStart
- truncate
- unescape
- upperCase
- upperFirst
- words
- Util
- attempt
- bindAll
- cond
- conforms
- constant
- flow
- flowRight
- identity
- iteratee
- matches
- matchesProperty
- method
- methodOf
- mixin
- noConflict
- noop
- nthArg
- over
- overEvery
- overSome
- property
- propertyOf
- range
- rangeRight
- runInContext
- times
- toPath
- uniqueId