# slice()

A method that returns a selected portion without changing the original array or string.

## What does **slice()** do in JavaScript?

**slice()** — A method that returns a selected portion without changing the original array or string.

```javascript
const tasks = ["Plan", "Build", "Test"];
const selectedTasks = tasks.slice(1);
```

Level: Apprentice · [More JavaScript terms at this level](https://www.ask-codey.com/glossary/subjects/javascript/apprentice)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/slice
