Opened 9 years ago
Closed 9 years ago
#14914 closed bug (notabug)
jQuery.indexOf fails where Array.prototype.indexOf works
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.11.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If you add an element to an array, and then use the jQuery.appendTo method to attach that element to another DOM node, jQuery.inArray will return -1 for that element.
jsFiddle link: http://jsfiddle.net/zVsr5
Note: See
TracTickets for help on using
tickets.
You have the arguments backwards. http://jsfiddle.net/zVsr5/2/ https://api.jquery.com/jQuery.inArray/
Please read the docs and sanity check code on StackOverflow or the jQuery forum before creating bug reports.