UNPKG

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