_.countBy(collection, [iteratee=_.identity])
  • 주어진 조건으로 갯수를 셈.
_.each -> forEach
_.eachRight -> forEachRight
_.every(collection, [predicate=_.identity])
  • 모든 원소가 조건을 만족하면 true
_.filter(collection, [predicate=_.identity])
  • 주어진 조건을 만족하는 원소의 배열을 반환
_.find(collection, [predicate=_.identity], [fromIndex=0])
  • 주어진 조건을 만족하는 첫번째 원소를 찾음
_.findLast(collection, [predicate=_.identity], [fromIndex=collection.length-1])
  • 주어진 조건을 만족하는 마지막 원소를 찾음
_.flatMap(collection, [iteratee=_.identity])
  • 주어진 조건으로 변환 + 직렬화한 배열 반환
_.flatMapDeep(collection, [iteratee=_.identity])
  • _.flayMap + 재귀적 직렬화_.flatMapDepth
_.flatMapDepth(collection, [iteratee=_.identity], [depth=1])
  • _.flatMap + depth만큼 직렬화
_.forEach(collection, [iteratee=_.identity])
  • 집합의 각 원소에 대해 iteratee 실행
_.forEachRight(collection, [iteratee=_.identity])
  • _.forEach + 오른쪽 원소부터 실행
_.groupBy(collection, [iteratee=_.identity])
  • iteratee를 통한 그룹
_.includes(collection, value, [fromIndex=0])
  • index부터 시작해서 집합이 값을 포함하는지 확인 (문자열일 경우 문자열이 포함하는지 확인)
_.invokeMap(collection, path, [args])
_.keyBy(collection, [iteratee=_.identity])
  • iteratee로 생성된 key로 구성된 집합 반환
_.map(collection, [iteratee=_.identity])
  • iteratee로 각 원소 변환한 집합 반환
_.orderBy(collection, [iteratees=[_.identity]], [orders])
  • _.soryBy + 키 직접 지정 가능
_.partition(collection, [predicate=_.identity])
  • 조건으로 두그룹으로 분리
_.reduce(collection, [iteratee=_.identity], [accumulator])
_.reduceRight(collection, [iteratee=_.identity], [accumulator])

 

_.reject(collection, [predicate=_.identity])
  • _.filter의 반대

 

_.sample(collection)

  • 집합 내의 무작위 원소 추출

 

_.sampleSize(collection, [n=1])
  • n개의 유니크 원소 추출

 

_.shuffle(collection)
  •  

 

_.size(collection)
  • 집합의 사이즈 추출 (문자열이면 길이)

 

_.some(collection, [predicate=_.identity])
  • 배열에 조건을 만족하는 원소가 하나라도 있는지

 

_.sortBy(collection, [iteratees=[_.identity]])
  • iteratee로 집합 정렬

 

 

 

'공식메뉴얼 > lodash' 카테고리의 다른 글

Array  (0) 2020.06.27
Lodash란?  (1) 2020.06.27

+ Recent posts