_.filter(list, (n) => n % 2) // → Array
_.find(list, (n) => n % 2) // → item
_.findLast(list, ...) // → item
Works for both arrays and objects.
_.at([ abcd ], 0) // → [ a ] - same as list[0]
_.at([ abcd ], [ 0, 1 ]) // → [ ab ]
_.chunk([ abcd ], 2) // → [ [ab], [cd] ]
_.compact(list)
_.fill(Array(4), 'x') // → [ 'x', 'x', 'x', 'x' ]
_.flatten
_.flattenDeep
_.drop([ abcdef ], 2) // → [ cdef ]
_.dropRight([ abcdef ], 2) // → [ abcd ]
_.take([ abcdef ], 2) // → [ ab ]
_.takeRight([ abcdef ], 2) // → [ de ]
_.slice([ abcdef ], 2, 4) // → [ cd ]
_.initial([ abcdef ]) // → [ abcde ] - dropRight(list, 1)
_.rest([ abcdef ]) // → [ bcdef ] - takeRight(list, 1)
_.dropWhile(list, 'active') // works like filter
_.dropWhile(list, 'active', true)
_.dropWhile(list, { active: true })
_.dropWhile(list, (n) => ...)
_.dropRightWhile(list, ...)
_.without([ abcde ], b) // → [ acde ]
_.remove(list, (n) => n % 2)
_.throttle(fn)
_.debounce(fn)
_.capitalize('hello world') // → 'Hello world'
_.startCase('hello_world') // → 'Hello World'
_.snakeCase('hello world') // → 'hello_world'
_.kebabCase('hello world') // → 'hello-world'
_.camelCase('hello world') // → 'helloWorld'
_.pad('abc', 3) // → 'abc'
_.pad('abc', 8) // → ' abc '
_.pad('abc', 8, '_-') // → '_-abc_-_'
_.padStart('abc', 3) // → 'abc'
_.padStart('abc', 6) // → ' abc'
_.padStart('abc', 6, '_-')// → '_-_abc'
_.padEnd('abc', 3) // → 'abc'
_.padEnd('abc', 6) // → 'abc '
_.padEnd('abc', 6, '_-') // → 'abc_-_'
_([1, 2, 3])
.reduce((total, n) => total + n)
.map((n) => n * n)
.tap(console.log)
.thru((n) => n.reverse())
.value()