Skip to main content

Bug Tracker

Side navigation

#14612 closed bug (notabug)

Opened December 06, 2013 05:57PM UTC

Closed December 06, 2013 07:34PM UTC

Broken slice() interface

Reported by: anonymous Owned by:
Priority: undecided Milestone: None
Component: core Version: 1.10.2
Keywords: dbr Cc:
Blocked by: Blocking:
Description

Slice takes a 0-indexed start position and a 1-indexed end position, "cleverly" described as 'the 0-indexed position where elements stop being selected'. Or, in other words, a 1-indexed ending position.

What's really awful is that the traditional slice interface is offset,length -- not offset_start,offset_end.

Most of jQuery's quirks make sense in the context of JavaScript, but this is just flat-out incorrect design.

Attachments (0)
Change History (1)

Changed December 06, 2013 07:34PM UTC by gibson042 comment:1

component: unfiledcore
keywords: → dbr
resolution: → notabug
status: newclosed

Arguments for jQuery's slice are in perfect Harmony with ECMA-262... we even pass them directly to the native method.