jQuery isArray() Method

Beginner
6 min read
Updated: Oct 2026
4 examples
Live preview

What Is isArray()?

jQuery.isArray(obj) (alias $.isArray) returns true when obj is a true JavaScript Array (since jQuery 1.3). Array-like objects are not arrays.

Remember
$.isArray(obj)  → true | false

$.isArray([])           // true
$.isArray({})           // false
$.isArray($("div"))     // false  (jQuery collection)
$.isArray("hi")         // false

// Prefer in new code:
Array.isArray([])       // true
NeedUse
Is it a true array? (legacy)$.isArray(obj)
Is it a true array? (modern)Array.isArray(obj)
Type string$.type(obj)
Array-like → array$.makeArray(obj)

How to Use isArray()

Pass any value; branch on the boolean result — or migrate to native.

  1. Have a value of unknown type (API data, option, argument).
  2. Call $.isArray(value) (legacy) or Array.isArray(value) (preferred).
  3. If true, treat it as a real array (.map, $.grep, etc.).
  4. If array-like but not an array, convert with $.makeArray() first.
PieceRequired?Role
objYesValue to test
Return—Boolean — true only for real arrays
Modern replacement—Array.isArray(obj)

Pseudocode

Pseudocode
function isArray(obj):
    // true only for real Array instances
    // false for {}, NodeList, jQuery, arguments, strings…
    return Array.isArray(obj)   // what modern jQuery uses

// Typical guard:
if isArray(data):
    process as array
else if array-like:
    data = makeArray(data)
else:
    handle non-list

Cheat Sheet

Keep these facts handy while checking array types.

TopicDetail
SyntaxjQuery.isArray(obj) / $.isArray(obj)
SincejQuery 1.3
StatusDeprecated 3.2 · removed 4.0
True for[], new Array(), array literals
False for{}, jQuery objects, NodeList, arguments
PreferArray.isArray()
Related$.type(obj) === "array"

Live Preview

Test common values with $.isArray (and see the native twin).

Browser demo of $.isArray() vs Array.isArray() — same idea as the examples below.

Result
value = []
$.isArray(value) → true
Array.isArray(value) → true

jQuery Examples

Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.

Example 1 — Array vs Plain Object

The classic true/false pair.

jQuery
console.log($.isArray([]));  // true
console.log($.isArray({}));  // false
Try It Yourself

How It Works

  1. Empty array. [] is a real Array → true.
  2. Empty object. {} is a plain object → false.
  3. Same typeof. Both look like "object" to typeof.
  4. Use case. Guard before treating API data as a list.

Example 2 — Array-Like Is Not an Array

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)
Try It Yourself

How It Works

  1. jQuery object. Has length and indexed elements, but is not an Array.
  2. Real array. [1, 2, 3] passes $.isArray.
  3. Length alone. $els.length can be positive while isArray is still false.
  4. Convert. Use $.makeArray($els) when you need array methods.

Example 3 — Why typeof Fails

Show the classic pitfall students hit first.

jQuery
console.log(typeof []);           // "object"
console.log(typeof {});           // "object"
console.log($.isArray([]));       // true
console.log($.isArray({}));       // false
Try It Yourself

How It Works

  1. typeof. Arrays and plain objects both report "object".
  2. isArray. Splits them correctly into true / false.
  3. Rule. Never use typeof value === "array" — that string never appears.
  4. Alternative. $.type([]) === "array" also works when you need the type string.

Example 4 — Prefer Array.isArray()

Same results, native API — the recommended replacement.

jQuery
console.log($.isArray([1, 2]));       // true
console.log(Array.isArray([1, 2]));   // true

console.log($.isArray("nope"));       // false
console.log(Array.isArray("nope"));   // false
Try It Yourself

How It Works

  1. Same answers. Both APIs agree on arrays and non-arrays.
  2. No jQuery needed. Array.isArray is built into modern browsers.
  3. Deprecated path. $.isArray remains for reading old code on jQuery 3.x.
  4. New projects. Call Array.isArray and skip the jQuery helper.

Edge Cases & Pitfalls

Check these before trusting a “list-like” value.

deprecated

Removed in jQuery 4.0

Do not add new $.isArray calls. Migrate to Array.isArray before upgrading past jQuery 3.x.

array-like

Length does not mean Array

jQuery objects, NodeLists, and arguments have length but return false. Convert with $.makeArray when needed.

typeof

typeof [] === "object"

Never use typeof to detect arrays. Use isArray / Array.isArray, or $.type for a type string.

null

null and primitives are false

$.isArray(null), undefined, numbers, and strings all return false — safe to call without a prior null check.

Browser Support

jQuery.isArray() is available from jQuery 1.3+ through jQuery 3.x. It is deprecated since 3.2 and removed in 4.0. Prefer Array.isArray() in all modern browsers.

✓ Deprecated · jQuery 3.x

jQuery.isArray()

Works in browsers with jQuery 1.3–3.x. For new code use Array.isArray() — supported in all current browsers. Not available in jQuery 4.0.

Legacy jQuery 3.x only
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
$.isArray() Legacy

Bottom line: Read $.isArray in legacy jQuery 3.x apps. Write Array.isArray(obj) for everything new.

Performance Notes

ApproachCostBest for
Array.isArray(x)O(1)All new code
$.isArray(x)O(1)Legacy jQuery 3.x only
$.type(x) === "array"Slightly heavierMulti-type branching

Array checks are cheap. Prefer the native call for clarity and to avoid a removed jQuery API — not for micro-speed gains.

Key Takeaways

  • Role: $.isArray(obj) → true only for real arrays.
  • Migrate: use Array.isArray() in new code.
  • Array-like: jQuery / NodeList → false.
  • Avoid: typeof cannot detect arrays.

One line: $.isArray detects real arrays only — learn it for legacy code, write Array.isArray going forward.

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.

Next: isEmptyObject()

Check whether a plain object has no enumerable properties.

isEmptyObject tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful