Skip to content

Glossary: JavaScript Basics

slice

A method on strings and arrays that returns a new piece from `start` up to but not including `end`, leaving the original untouched. On an array, `slice()` with no arguments makes a copy.

Where the book teaches it

Related terms

spliceReference