libs/lodash.js
function toArray(collection) {
      var length = collection && collection.length;
      if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
        return slice(collection);
      }
      return values(collection);
    }
function toArray(collection) {
      var length = collection && collection.length;
      if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
        return slice(collection);
      }
      return values(collection);
    }
function toArray ( collection ) { var length = collection && collection . length ; if ( typeof length == 'number' && length > - 1 && length <= maxSafeInteger ) { return slice ( collection ) ; } return values ( collection ) ; }
Converts `collection` to an array.

@static
@memberOf _
@category Collections
@param {Array|Object|string} collection The collection to convert.
@returns {Array} Returns the new converted array.
@example

(function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
// => [2, 3, 4]
Converts collection to an array .