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: | dh@madisonsolutions.co.uk | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 2.1.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
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));
true
$.isArray(new Float32Array(1));
false
$.isArray(new Float64Array(1));
false
$.isArray(new Int8Array(1));
false
$.isArray(new Int16Array(1));
false
$.isArray(new Int32Array(1));
false
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.
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: http://bugs.jquery.com