Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14914 closed bug (notabug)

jQuery.indexOf fails where Array.prototype.indexOf works

Reported by: agnijith@… 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

Change History (1)

comment:1 Changed 6 years ago by dmethvin

Resolution: notabug
Status: newclosed

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.

Note: See TracTickets for help on using tickets.