Opened 9 years ago
Closed 9 years ago
#14860 closed bug (notabug)
jQuery isArray does not work correctly
Reported by: | 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
Note: See
TracTickets for help on using
tickets.
document.getElementsByTagName('div')
doesn't return an Array, it returns a live NodeList