更新时间:2022-09-10 16:32:17
前端开发人员大都喜欢 Underscore,它的工具函数很实用,用法简单。这里给大家推荐另外一个功能更全面的 JavaScript 工具——Lo-Dash,帮助你更好的开发网站和 Web 应用程序。
_(…)
supports intuitive chaining_.at
for cherry-picking values_.bindKey
for binding “lazy” defined methods_.clone
supports shallow cloning of Date
& RegExp
objects_.cloneDeep
for deep cloning arrays & objects_.contains
accepts a fromIndex
_.createCallback
for extending callbacks in methods & mixins_.curry
for creating curried functions_.debounce
& _.throttle
accept additional options
for more control_.findIndex
& _.findKey
for finding indexes & keys_.forEach
is chainable & supports exiting early_.forIn
for iterating own & inherited properties_.forOwn
for iterating own properties_.isPlainObject
for checking if values are created by Object
_.memoize
exposes the cache
of memoized functions_.merge
for a deep _.extend
_.parseInt
for consistent behavior_.partialRight
for partial application from the right_.pull
& _.remove
for mutating arrays_.random
supports returning floating-point numbers_.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_.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
本文链接:Lo-Dash – 替代 Underscore 的优秀 JS 工具库
编译来源:梦想天空 ◆ 关注前端开发技术 ◆ 分享网页设计资源
作者:山边小溪
主站:yyyweb.com 记住啦:)
欢迎任何形式的转载,但请务必注明出处。