2017년 1월 15일 일요일

underscore 스터디 중 Collection 함수 유형별 분류 결과

개발팀내에서 underscore.js 스터디를 하고 있는데, Collection 함수들에 대해서 유형별로 정리하면서 진행을 했다. 아래는 그 결과이다.

filter ( [a,b,c] -> [b,c] )
_.filter
_.where
_.reject
_.sample
_.first
_.last
_.initial
_.rest
_.compact
_.without
_.union
_.intersection
_.difference
_.uniq


map ( [a,b,c] -> [A,B,C] )
_.each
_.map
_.invoke
_.pluck
_.sortBy
_.groupBy
_.indexBy
_.shuffle
_.toArray
_.partition
_.flatten
_.zip
_.unzip


reduce ( [a,b,c] -> abc )
_.reduce
_.reduceRight
_.find
_.findWhere
_.every
_.some
_.contains
_.max
_.min
_.countBy
_.sample
_.size
_.first
_.last
_.indexOf
_.lastIndexOf
_.sortedIndex
_.findIndex
_.findLastIndex


object ( [] -> {} )
_.object


range ( 3 -> [1,2,3] )
_.range

댓글 없음:

댓글 쓰기