#4188 closed enhancement (fixed)
.get(-n)
Reported by: | Robert Katić | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | core | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Enable use of negative numbers as argument.
get: function( num ) { ... return this[ num < 0 ? this.length + num : num ]; }
Change History (6)
comment:2 follow-up: 3 Changed 13 years ago by
An alternative and more optimized solution of eq(n) would be:
eq: function( i ) { return this.pushStack( this.get(i), 'eq', i ) }
comment:3 Changed 13 years ago by
This last solution is not enough to handle the "out of range" case and when value is not true. So forget it.
comment:4 Changed 13 years ago by
Milestone: | 1.3.2 → 1.3.3 |
---|
Note: See
TracTickets for help on using
tickets.