7

Quoting Crockford in JavaScript The Good Parts:

We can ... define our own is_array function:

var is_array = function (value) {
    return value && typeof value === 'object' && value.constructor === Array;
}

Unfortunately, it fails to identify arrays that were constructed in a different Windows or frame.

And then he doesn't explain why. So! Why?

Kevin Brown-Silva
  • 40,873
  • 40
  • 203
  • 237
djechlin
  • 59,258
  • 35
  • 162
  • 290

0 Answers0