Skip to content

unctionjs/length

Repository files navigation

@unction/length

Tests Stability Dependencies

Array | Set | Record<string | number | symbol, B> | Map<B, A> | string => number

Returns the number of values contained in the enumerable.

length([1, 2, 3]) // 3
length({aaa: "aaa", bbb: "bbb"}) // 2
length(new Map([["aaa", "aaa"], ["bbb", "bbb"]])) // 2
length(new Set([1, 2, 3])) // 3