Skip to main content

Bug Tracker

Side navigation

#14860 closed bug (notabug)

Opened March 06, 2014 10:37PM UTC

Closed March 06, 2014 10:45PM UTC

jQuery isArray does not work correctly

Reported by: chihungyu1116@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0-rc1
Keywords: Cc:
Blocked by: Blocking:
Description

var tags = document.getElementsByTagName('div');

jQuery.isArray(tags) returns false

Array.isArray(tags) returns false

function isArray(object){

return typeof object === "object" && object.length > -1;

}

isArray(tags) return true

shouldn't the implemtation be more like the one I have above?

https:stackoverflow.com/questions/22237597/jquery-and-array-isarray-not-working-correctly

Attachments (0)
Change History (1)

Changed March 06, 2014 10:45PM UTC by rwaldron comment:1

resolution: → notabug
status: newclosed

document.getElementsByTagName('div') doesn't return an Array, it returns a live NodeList