check if object is an array.
//check if array function is_array(elem) { return elem.constructor === Array; }