实用JavaScript工具库:Lo-Dash
jopen
11年前
Lo-Dash是一个实用的JavaScript工具库。提供一致性,定制,性能,及附加功能。
- ~100% code coverage
- Module bundles for AMD & Node.js as well as npm packages
- Follows semantic versioning for releases
_(…)
supports intuitive chaining_.at
for cherry-picking values_.bindKey
for binding “lazy” defined methods_.clone
supports shallow cloning ofDate
&RegExp
objects_.cloneDeep
for deep cloning arrays & objects_.contains
accepts afromIndex
_.create
for easier object inheritance_.createCallback
for extending callbacks in methods & mixins_.curry
for creating curried functions_.debounce
&_.throttle
accept additionaloptions
for more control_.findIndex
&_.findKey
for finding indexes & keys_.forEach
supports exiting early_.forIn
for iterating own & inherited properties_.forOwn
for iterating own properties_.isPlainObject
for checking if values are created byObject
_.mapValues
for mapping values to an object_.memoize
exposes thecache
of memoized functions_.merge
for a deep_.extend
_.noop
for function placeholders_.parseInt
for consistent behavior_.pull
&_.remove
for mutating arrays_.random
supports returning floating-point numbers_.sortBy
supports sorting by multiple properties_.runInContext
for easier mocking_.support
for flagging environment features_.template
supports “imports” options & ES6 template delimiters_.transform
as a powerful alternative to_.reduce
for transforming objects_.where
supports deep comparisons_.xor
as a companion to_.difference
,_.intersection
, &_.union
_.zip
is capable of unzipping values_.omit
,_.pick
, & more accept callbacks_.contains
,_.toArray
, & more accept strings_.filter
,_.map
, & more support “_.pluck” & “_.where” shorthands_.findLast
,_.findLastIndex
, & more right-associative methods
_.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]