Learn jQuery.isArray(): test for a true JavaScript array, avoid array-like false positives, migrate to Array.isArray (deprecated 3.2), examples, pitfalls, and FAQs.
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Have a value of unknown type (API data, option, argument).
Step 2
Call $.isArray(value) (legacy) or Array.isArray(value) (preferred).
Step 3
If true, treat it as a real array (.map, $.grep, etc.).
Return Value
Return Value
Description
Boolean
Often true or false depending on the match or state.
Value / undefined
Getters usually return a value from the first matched element, or undefined when nothing applies.
jQuery collections look list-like but fail the test.
jQuery
var $els = $("body");
var real = [1, 2, 3];
console.log($.isArray($els)); // false
console.log($.isArray(real)); // true
console.log($els.length); // 1 (array-like, still not an Array)
typeof. Arrays and plain objects both report "object".
isArray. Splits them correctly into true / false.
Rule. Never use typeof value === "array" — that string never appears.
Frequently Asked Questions
jQuery.isArray(obj) returns true when obj is a true JavaScript Array, and false otherwise. It does not treat array-like objects (jQuery collections, NodeLists, arguments) as arrays.
Yes. It was deprecated in jQuery 3.2 and removed in jQuery 4.0. Prefer the native Array.isArray() method in all new code.
No. NodeLists, HTMLCollections, arguments, and jQuery DOM collections return false. Convert with $.makeArray() (or Array.from) if you need a real array.
Both test for true arrays. In modern jQuery, $.isArray typically delegates to Array.isArray. Use Array.isArray in new projects; keep $.isArray only when reading legacy jQuery code.
typeof [] returns "object", the same as plain objects. That cannot tell arrays from {}. Use $.isArray() or Array.isArray() instead.
jQuery.type(value) returns the string "array" for arrays. jQuery.isArray(value) returns true for those same values. Prefer isArray (or Array.isArray) when you only need true/false.
Yes, if an older jQuery that still includes isArray is loaded. Prefer Array.isArray everywhere — it is native and does not need jQuery.