Object or Array
Tuesday, March 6th, 2007
Find whether the given variable is an object,or is an Array?
function isArray(testObject) {
return testObject && !(testObject.propertyIsEnumerable('length')) && typeof testObject === 'object' && typeof testObject.length === 'number';
}
Original Page
[tags]javascript,object,array,type[/tags]