前端开发人员大都喜欢 Underscore,它的工具函数很实用,用法简单。这里给大家推荐另外一个功能更全面的 JavaScript 工具——Lo-Dash,帮助你更好的开发网站和 Web 应用程序。
您可能感兴趣的相关文章
Lo-Dash 特色功能:
- AMD loader support (curl, dojo, requirejs, etc.)
-
_(…)supports intuitive chaining -
_.atfor cherry-picking values -
_.bindKeyfor binding “lazy” defined methods -
_.clonesupports shallow cloning ofDate&RegExpobjects -
_.cloneDeepfor deep cloning arrays & objects -
_.containsaccepts afromIndex -
_.createCallbackfor extending callbacks in methods & mixins -
_.curryfor creating curried functions -
_.debounce&_.throttleaccept additionaloptionsfor more control -
_.findIndex&_.findKeyfor finding indexes & keys -
_.forEachis chainable & supports exiting early -
_.forInfor iterating own & inherited properties -
_.forOwnfor iterating own properties -
_.isPlainObjectfor checking if values are created byObject -
_.memoizeexposes thecacheof memoized functions -
_.mergefor a deep_.extend -
_.parseIntfor consistent behavior -
_.partialRightfor partial application from the right -
_.pull&_.removefor mutating arrays -
_.randomsupports returning floating-point numbers -
_.runInContextfor easier mocking -
_.supportfor flagging environment features -
_.templatesupports “imports” options & ES6 template delimiters -
_.transformas a powerful alternative to_.reducefor transforming objects -
_.wheresupports deep comparisons -
_.zipis 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 工具库
编译来源:梦想天空 ◆ 关注前端开发技术 ◆ 分享网页设计资源