1 | import _curry1 from "./internal/_curry1.js";
|
2 | import _isNumber from "./internal/_isNumber.js";
|
3 | /**
|
4 | * Returns the number of elements in the array by returning `list.length`.
|
5 | *
|
6 | * @func
|
7 | * @memberOf R
|
8 | * @since v0.3.0
|
9 | * @category List
|
10 | * @sig [a] -> Number
|
11 | * @param {Array} list The array to inspect.
|
12 | * @return {Number} The length of the array.
|
13 | * @example
|
14 | *
|
15 | * R.length([]); //=> 0
|
16 | * R.length([1, 2, 3]); //=> 3
|
17 | */
|
18 |
|
19 | var length =
|
20 | /*#__PURE__*/
|
21 | _curry1(function length(list) {
|
22 | return list != null && _isNumber(list.length) ? list.length : NaN;
|
23 | });
|
24 |
|
25 | export default length; |
\ | No newline at end of file |