Skip to main content

Bug Tracker

Side navigation

#14767 closed bug (notabug)

Opened February 06, 2014 09:53PM UTC

Closed February 06, 2014 09:58PM UTC

Last modified February 09, 2014 08:04PM UTC

isArray returns false for the new typed arrays

Reported by: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 2.1.0
Keywords: Cc:
Blocked by: Blocking:

I would expect $.isArray to return true for the new typed array objects - eg Float32Array and Int16Array, etc. In actual fact, all return false:

$.isArray(new Array(1));


$.isArray(new Float32Array(1));


$.isArray(new Float64Array(1));


$.isArray(new Int8Array(1));


$.isArray(new Int16Array(1));


$.isArray(new Int32Array(1));


However, it might be deliberate behaviour to return false, because typed arrays don't support all the same functions as standard arrays - eg push, pop, map etc. If so, this behaviour should be documented.

Attachments (0)
Change History (2)

Changed February 06, 2014 09:58PM UTC by dmethvin comment:1

resolution: → notabug
status: newclosed

This is definitely a docs issue, isArray is primarily for our internal needs and we have no need/desire to consume any of those arrayish types. Please open a ticket in the docs repo, as described in the page you passed through:

Changed February 09, 2014 08:04PM UTC by axl.jq comment:2

I suggest not changing this, if those new types doesn't implement all expected properties/methods from Array