source: node_modules/ramda/es/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: 587 bytes
Line 
1import _curry1 from "./internal/_curry1.js";
2import _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
19var length =
20/*#__PURE__*/
21_curry1(function length(list) {
22 return list != null && _isNumber(list.length) ? list.length : NaN;
23});
24
25export default length;
Note: See TracBrowser for help on using the repository browser.