Name

slice() — NN 4 IE J3 ECMA n/a

Synopsis

slice(startIndex[,
endIndex])

Returns an array that is a subset of contiguous items from the main array. Parameters determine where the selection begins and ends.

Returned Value

An Array object.

Parameters

startIndex

A zero-based integer of the first item of the subset from the current array.

endIndex

An optional zero-based integer of the last item of the subset from the current array. If omitted, the selection is made from the startIndex position to the end of the array.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.