UnderZ

Javascript Library.

Convert variable to Array

Convert the given variable to an Array Strings do split


Convert to array

_z.toArray( anyObject );

Returns: Array An array with the given elements.


Examples:

var x = {};
var x["data"] = 123;
var x["data1"] = "more data"; 


_z.toArray(x); // [{data:123, data1:"more data"}]
_z.toArray("abc"); // ['a', 'b', 'c']
_z.toArray(123); // [123]
_z.toArray( _z("button") ); // array of DOM element with tag button