Skip to main content

Bug Tracker

Side navigation

#3274 closed bug (wontfix)

Opened August 21, 2008 12:33PM UTC

Closed August 21, 2008 02:33PM UTC

Last modified August 22, 2008 10:31AM UTC

.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)
Change History (3)

Changed August 21, 2008 02:33PM UTC by flesler comment:1

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.

Changed August 22, 2008 09:16AM UTC by djot comment:2

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).

"

Changed August 22, 2008 10:31AM UTC by flesler comment:3

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