what’s the best way to determine whether a Javascript variable is an array, but has no other user-defined properties? ‘instanceof Array’ doesn’t do this.
e.g.
var var1 = [10,11];
var1['key1'] = 'extraProperty';
var1 instanceof Array; //returns true
This function confirms that it’s an
Arrayand that every defined property on an object is an integer index that’s in the range specified by.length.