source: node_modules/ramda/src/length.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 625 bytes
Line 
1var _curry1 =
2/*#__PURE__*/
3require("./internal/_curry1.js");
4
5var _isNumber =
6/*#__PURE__*/
7require("./internal/_isNumber.js");
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;
Note: See TracBrowser for help on using the repository browser.