Skip to content

Glossary: Data Structures and Algorithms in JavaScript

Slice

Also written: slice

An array or string method that returns a copy of a range of items, costing O(k) for k items. Changing a slice doesn't change the original.

Where the book teaches it

Related terms

Array