function is_array( mixed_var ) { // Finds whether a variable is an array
//
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: Legaev Andrey
// + bugfixed by: Cord
return ( mixed_var instanceof Array );
}
Не совсем рабочий пример ... вот более менее лучше ...
function is_array(inputArray) {
return inputArray && !(inputArray.propertyIsEnumerable('length')) && typeof inputArray === 'object' && typeof inputArray.length === 'number';
}