MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / toArray

Function toArray

lib/web/jshint.js:10469–10478  ·  view source on GitHub ↗

* Converts `value` to an array. * * @static * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {Array} Returns the converted array. * @example * * (function() { * return _.toArray(arguments).slice(1); * }(1, 2,

(value)

Source from the content-addressed store, hash-verified

10467 * // => [2, 3]
10468 */
10469 function toArray(value) {
10470 var length = value ? getLength(value) : 0;
10471 if (!isLength(length)) {
10472 return values(value);
10473 }
10474 if (!length) {
10475 return [];
10476 }
10477 return arrayCopy(value);
10478 }
10479
10480 /**
10481 * Converts `value` to a plain object flattening inherited enumerable

Callers

nothing calls this directly

Calls 3

isLengthFunction · 0.85
valuesFunction · 0.85
arrayCopyFunction · 0.85

Tested by

no test coverage detected