Ticket #10948 (closed enhancement: duplicate)
Proposing to add similar to $.fn.eq behavior for $.fn.end method.
| Reported by: | markel | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Sometimes traverse chain might be long, sometimes it is required to climb couple states up, instead of one.
Than, in order not to break chain and not traverse some more, it's need to call end method couple times, like when you use parentNode property in DOM.
I'm proposing to eliminate this calls by replacing them to just one call with extra argument if needed.
Change History
comment:2 Changed 18 months ago by scott.gonzalez
I feel like this had been proposed before and denied because it encourages developers to write code that is hard to read. I can't seem to find the old discussion, I did a quick check in Trac and the 1.6 and 1.7 roadmap proposals.
comment:3 Changed 18 months ago by dmethvin
- Status changed from new to closed
- Resolution set to duplicate
Definitely makes code harder to read. Match up each filtering method with an .end() instead.
We like to keep the pull queue relatively clean, so please query about these on #jquery-dev before making pull requests.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Pull request -- https://github.com/jquery/jquery/pull/619