Opened 9 years ago
Closed 9 years ago
#14431 closed bug (notabug)
Iterator variable passed as reference?
Reported by: | Kindzoku | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
http://jsfiddle.net/zFfV8/ Hi. Just tried to write pager for my widget and have found this. Sorry in advance, in case this is right behaviour.
Note: See
TracTickets for help on using
tickets.
The value is not passed as a reference—it's a primitive. This is not a jQuery bug and it's how JavaScript for-loop vars work. Use jQuery.each to get a properly scoped "i": http://jsfiddle.net/rwaldron/5EuxG/