iteratee
_.iteratee(value, [context])
生成可应用于集合中的每个元素的回调。_.iteratee
支持许多常见回调用例的简写语法。根据值的类型,_.iteratee
将返回:
通过_.iteratee
转换判断的 Underscore 方法的完整列表是: countBy
, every
,filter
, find
, findIndex
, findKey
,findLastIndex
, groupBy
, indexBy
,map
, mapObject
, max
, min
,partition
, reject
, some
, sortBy
,sortedIndex
, and uniq
如果您需要其他或不同的简写语法,可以使用自己的自定义函数覆盖 _.iteratee
: