Lodash
https://gyazo.com/c513b5501fd3648c1694ae058707a2b6
code:js
const _ = require('lodash') // load the full build.
サイズが大きいので使うものだけloadしたほうがよい
$ npm install lodash.difference
code:js
import difference from 'lodash.difference'
よく使われそうなのを集約
Array
_.chunk(array, [size=1])
_.compact(array)
_.difference(array, [values])
_.fill(array, value, [start=0], [end=array.length])
_.flattenDeep(array)
_.intersection([arrays])
_.pull(array, [values])
_.remove(array, [predicate=_.identity])
_.union([arrays])
_.uniq(array)
_.without(array, [values])
_.xor([arrays])
Collection
_.filter(collection, [predicate=_.identity])
_.forEach(collection, [predicate=_.identity])
_.map(collection, [predicate=_.identity])
_.reduce(collection, [predicate=_.identity], [accumulator])
_.reject(collection, [predicate=_.identity])
_.size(collection)
_.sortBy(collection, [predicate=_.identity])
Date
Function
Lang
_.cloneDeep(value)
_.isEmpty(value)
_.isEqual(value, other)
_.toArray(value)
Math
_.max(array)
_.min(array)
_.sum(array)
Number
Object
Seq
String
Util
_.range([start=0], end, [step=1])
Properties
Methods
ref