toArray()

Turns anything into an array.

This function is valid in v2.0.0 to v2.14.0. This function has been downloaded 43 times.

Parameter

{*=} o Optional
Any value to either convert to an array or wrap in an array.

Returns

{Array}
If no arguments were passed an empty array is returned. If the argument passed was array-like it will be returned as an Array. Otherwise the argument passed will simply be returned within an array.

Required Functions

This function requires the following functions which are included automatically:

  • slice()
    Slice does not modify the original array, but instead returns a shallow copy of elements from the original array.
  • isArrayLike()
    Determines if an object is an array or at least array-like.