What did Douglas Crockford mean when he mentioned that the is_array()
test might not correctly identify arrays created in a different window or frame?
var is_array = function (value) {
return value &&
typeof value === 'object' &&
value.constructor === Array;
How does the following code account for windows and frames when determining if a variable is an array?
var is_array = function (value) {
return value &&
typeof value === 'object' &&
typeof value.length === 'number' &&
typeof value.splice === 'function' &&
!(value.propertyIsEnumerable('length'));
};