https://github.com/lodash/lodash/wiki/Migrating
let fixList = [
"collect",
"inject",
"foldl",
"foldr",
"detect",
"select",
"all",
"any",
"include",
"contains",
"pluck",
"where",
'findWhere',
"indexBy",
"unique",
"object",
"compose",
"restArguments",
"allKeys",
"mapObject",
"pairs",
"methods",
"extendOwn",
"matcher"
]
let fixList = [
"collect",
"inject",
"foldl",
"foldr",
"detect",
"select",
"all",
"any",
"include",
"contains",
"pluck",
"where",
'findWhere',
"indexBy",
"unique",
"object",
"compose",
"restArguments",
"allKeys",
"mapObject",
"pairs",
"methods",
"extendOwn",
"matcher"
]
- Underscore
_.any
is Lodash_.some
- Underscore
_.all
is Lodash_.every
- Underscore
_.compose
is Lodash_.flowRight
- Underscore
_.contains
is Lodash_.includes
- Underscore
_.each
doesn’t allow exiting by returningfalse
- Underscore
_.findWhere
is Lodash_.find
- Underscore
_.flatten
is deep by default while Lodash is shallow - Underscore
_.indexOf
with 3rd parameterundefined
is Lodash_.indexOf
- Underscore
_.indexOf
with 3rd parametertrue
is Lodash_.sortedIndexOf
- Underscore
_.indexBy
is Lodash_.keyBy
- Underscore
_.invoke
is Lodash_.invokeMap
- Underscore
_.mapObject
is Lodash_.mapValues
- Underscore
_.max
combines Lodash_.max
&_.maxBy
- Underscore
_.min
combines Lodash_.min
&_.minBy
- Underscore
_.sample
combines Lodash_.sample
&_.sampleSize
- Underscore
_.object
combines Lodash_.fromPairs
and_.zipObject
- Underscore
_.omit
by a predicate is Lodash_.omitBy
- Underscore
_.pairs
is Lodash_.toPairs
- Underscore
_.pick
by a predicate is Lodash_.pickBy
- Underscore
_.pluck
is Lodash_.map
- Underscore
_.uniq
by aniteratee
is Lodash_.uniqBy
- Underscore
_.where
is Lodash_.filter
- Underscore
_.isFinite
doesn’t align withNumber.isFinite
(e.g._.isFinite('1')
returnstrue
in Underscore butfalse
in Lodash) - Underscore
_.matches
shorthand doesn’t support deep comparisons
(e.g._.filter(objects, { 'a': { 'b': 'c' } })
) - Underscore ≥ 1.7 & Lodash
_.template
syntax is_.template(string, option)(data)
- Lodash
_.memoize
caches areMap
like objects - Lodash doesn’t support a
context
argument for many methods in favor of_.bind
- Lodash supports implicit chaining, lazy chaining, & shortcut fusion
- Lodash split its overloaded
_.head
,_.last
,_.rest
, &_.initial
out into
_.take
,_.takeRight
,_.drop
, &_.dropRight
(i.e._.head(array, 2)
in Underscore is_.take(array, 2)
in Lodash)