Skip to content
Hyunseung Ryu edited this page Apr 30, 2023 · 3 revisions

max

_(this).max()

객체의 최댓값을 반환합니다.

Parameters

name type description
this Array | Set 순회할 객체

Returns

type description
* 객체의 최댓값

Examples

_([1, 2, 3]).max(); // 3
_(new Set([1, 2, 3])).max(); // 3

maxBy

_(this).maxBy([by=(e => e)])

객체의 요소 중 by 함수의 반환값이 가장 큰 요소를 반환합니다.

Parameters

name type description
this Array | Set 순회할 객체
[by=(e => e)] Function 요소마다 호출할 함수, 첫번째 인자는 요소(value)

Returns

type description
* by 함수의 반환값이 가장 큰 요소

Examples

_([{a: 1}, {a: 2}, {a: 3}]).maxBy(v => v.a); // {a: 3}

min

_(this).min()

객체의 최솟값을 반환합니다.

Parameters

name type description
this Array | Set 순회할 객체

Returns

type description
* 객체의 최솟값

Examples

_([1, 2, 3]).min(); // 1
_(new Set([1, 2, 3])).min(); // 1

minBy

_(this).minBy([by=(e => e)])

객체의 요소 중 by 함수의 반환값이 가장 작은 요소를 반환합니다.

Parameters

name type description
this Array | Set 순회할 객체
[by=(e => e)] Function 요소마다 호출할 함수, 첫번째 인자는 요소(value)

Returns

type description
* by 함수의 반환값이 가장 작은 요소

Examples

_([{a: 1}, {a: 2}, {a: 3}]).minBy(v => v.a); // {a: 1}

product

_(this).product()

객체의 모든 요소의 곱을 반환합니다.

Parameters

name type description
this Array | Set 순회할 객체

Returns

type description
* 객체의 모든 요소의 곱

Examples

_([2, 2, 3]).product(); // 12
_(new Set([2, 3, 4])).product(); // 24

productBy

_(this).productBy([by=(e => e)])

객체의 모든 요소의 곱을 반환합니다.

Parameters

name type description
this Array | Set 순회할 객체
[by=(e => e)] Function 요소마다 호출할 함수, 첫번째 인자는 요소(value)

Returns

type description
* 객체의 모든 요소의 곱

Examples

_([{a: 2}, {a: 3}, {a: 4}]).productBy(v => v.a); // 24

sum

_(this).sum()

객체의 모든 요소의 합을 반환합니다.

Parameters

name type description
this Array | Set 순회할 객체

Returns

type description
* 객체의 모든 요소의 합

Examples

_([2, 3, 4]).sum(); // 9
_(new Set([2, 3, 4])).product(); // 9

sumBy

_(this).sumBy([by=(e => e)])

객체의 모든 요소의 합을 반환합니다.

Parameters

name type description
this Array | Set 순회할 객체
[by=(e => e)] Function 요소마다 호출할 함수, 첫번째 인자는 요소(value)

Returns

type description
* 객체의 모든 요소의 합

Examples

_([{a: 1}, {a: 2}, {a: 4}]).sumBy(v => v.a); // 7
Clone this wiki locally