1 /** Used as references for various `Number` constants. */
2 var MAX_SAFE_INTEGER = 9007199254740991;
5 * Checks if `value` is a valid array-like length.
7 * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
12 * @param {*} value The value to check.
13 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
19 * _.isLength(Number.MIN_VALUE);
22 * _.isLength(Infinity);
28 function isLength(value) {
29 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
32 module.exports = isLength;