jQuery.fnjust matches the array requirements for developer consoles . This is not an actual instance Array*, but it has an interface that allows you to process an array.
* If it jQuery.fnwas actually an array, jQuery.fn instanceof Arraywould appreciate true; this is not true. However, it copies some of the methods Array.prototype.
, Array, , - obj instanceof Array, , Array. , , , Array, :
function isArray(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
}
:
var a, b;
function Foo() {}
Foo.prototype = [];
a = new Foo();
b = [];
a instanceof Array;
b instanceof Array;
isArray(a);
isArray(b);