Bug Tracker


Ticket #6825 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

Use Array.isArray for jQuery.isArray when available

Reported by: salty-horse Owned by:
Priority: Milestone: 1.4.3
Component: core Version: 1.4.2
Keywords: Cc:
Blocking: Blocked by:


Originally posted on the  forum

Patch available on github:  http://github.com/salty-horse/jquery/commits/array

ECMAScript 5 defines Array.isArray which is available in Firefox and WebKit (only ones I checked).

I think jQuery should use it, if available, instead of checking the object's toString being "[object Array]".

For one, it will solve a problem I have with WebKit and Qt. It allows one to expose Qt arrays in javascript, but those are of the RuntimeArray class. This causes the jQuery isArray function to fail identifying them as arrays, while the native Array isArray succeeds.

Change History

comment:1 Changed 4 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.