Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3274 closed bug (wontfix)

.slice() misses "end" selection

Reported by: djot Owned by:
Priority: major Milestone: 1.3
Component: core Version: 1.2.6
Keywords: slice Cc:
Blocked by: Blocking:

Description

- hi,

the slice function DOES NOT include the "end" argument, which is really stupid.

See attached screenshots:

  • 3,4 only selects ONE div
  • 4,6 misses the sixth div (count from zero)

I doubt that this is the wanted behaviour - anyway if it is NOT a bug, than please change the documentation saying the last "end" element is not included in the selection.

djot -

Attachments (2)

bug_slice_34.gif (5.9 KB) - added by djot 13 years ago.
bug_slice_46.gif (4.9 KB) - added by djot 13 years ago.

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by djot

Attachment: bug_slice_34.gif added

Changed 13 years ago by djot

Attachment: bug_slice_46.gif added

comment:1 Changed 13 years ago by flesler

Resolution: wontfix
Status: newclosed

jQuery.fn.slice works exactly as Array.prototype.slice (the latter is actually used).

docs.jquery.com is down now, I'll check how is it documented, later.

comment:2 Changed 13 years ago by djot

copied from your link:

"
end
Zero-based index at which to end extraction. slice extracts up to but not including end.
slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3). "

comment:3 Changed 13 years ago by flesler

I know, it does skip the last as that page says. That's how it works.

Note: See TracTickets for help on using tickets.