Array
_.chunk
_.compact
_.concat
_.difference
_.differenceBy
_.differenceWith
_.drop
_.dropRight
_.dropRightWhile
_.dropWhile
_.fill
_.findIndex
_.findLastIndex
_.flatten
_.flattenDeep
_.flattenDepth
_.fromPairs
_.head
_.indexOf
_.initial
_.intersection
_.intersectionBy
_.intersectionWith
_.join
_.last
_.lastIndexOf
_.nth
_.pull
_.pullAll
_.pullAllBy
_.pullAllWith
Collection
Date
Function
Lang
_.castArray
_.clone
_.cloneDeep
_.cloneDeepWith
_.cloneWith
_.conformsTo
_.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
Math
Object
Seq
String
_.camelCase
_.capitalize
_.deburr
_.endsWith
_.escape
_.escapeRegExp
_.kebabCase
_.lowerCase
_.lowerFirst
_.pad
_.padEnd
_.padStart(string ='',length = 0,chars ='')
_.parseInt
_.repeat(string ='',n = 1)
_.replace(string ='',pattern,replacement)
_.snakeCase
_.split
_.startCase
_.startsWith
_.template
_.toLower
_.toUpper
_.trim
_.trimEnd(string ='',chars = whitespace)
_.trimStart
_.truncate
_.unescape
_.upperCase
_.upperFirst
Util
_.attempt
_.bindAll
_.cond
_.conforms
_.constant
_.defaultTo
_.flow
_.flowRight
_.identity
_.iteratee
_.matches
_.matchesProperty
_.method
_.methodOf
_.mixin
_.noConflict
_.noop
_.nthArg
_.over
_.overEvery
_.overSome
_.property
_.propertyOf
_.range
_.rangeRight
_.runInContext
_.stubArray()
_.stubFalse
_.stubObject
_.stubString
_.stubTrue
_.times
_.toPath
_.uniqueId
Methods
通过运行iteratee中的每个元素来创建一个值的数组。 迭代器被调用三个参数:
(value, index|key, collection).
可以用许多lodash方法防护,iteratees工作如下:_.every
,_.filter
, _.map
,_.mapValues
,_.reject
,和_.some
。
防护的方法是:
ary
, chunk
, curry
, curryRight
, drop
, dropRight
, every
, fill
, invert
, parseInt
, random
, range
, rangeRight
, repeat
, sampleSize
, slice
, some
, sortBy
, split
, take
, takeRight
, template
, trim
, trimEnd
, trimStart
, and words
0.1.0
collection
(Array | Object):迭代的集合。 [iteratee=_.identity]
(Function):每次迭代调用的函数。 (Array):返回新的映射数组。
function square(n) { return n * n; } _.map([4, 8], square); // => [16, 64] _.map({ 'a': 4, 'b': 8 }, square); // => [16, 64] (iteration order is not guaranteed) var users = [ { 'user': 'barney' }, { 'user': 'fred' } ]; // The `_.property` iteratee shorthand. _.map(users, 'user'); // => ['barney', 'fred']