//see if toString returns proper class attributes of objects that are arrays//returns -1 if it fails test//returns true if it passes test and it's an array//returns false if it passes test and it's not an arrayfunction is_array(o){// make sure an array has a class attribute of [object Array]var check_class = Object.prototype.toString.call([]);if(check_class === '[object Array]'){// test passed, now checkreturn Object.prototype.toString.call(o) === '[object Array]';}else{// may want to change return value to something more desirablereturn -1;}}
function is_array(o){// make sure an array has a class attribute of [object Array]var check_class = Object.prototype.toString.call([]);if(check_class === '[object Array]') {// test passed, now checkreturn Object.prototype.toString.call(o) === '[object Array]';} else{// may want to change return value to something more desirablereturn -1;}}
var is_array = function (value) {return value &&typeof value === 'object' &&typeof value.length === 'number' &&typeof value.splice === 'function' &&!(value.propertyIsEnumerable('length'));};
var is_array = function (value) {return value &&typeof value === 'object' &&typeof value.length === 'number' &&typeof value.splice === 'function' &&!(value.propertyIsEnumerable('length'));};