JavaScript 2025 · Arrays

Copy an array

Make a shallow copy with spread.

const copy = [...items];

Official JavaScript 2025 documentation

More arrays commands

All arrays commands · JavaScript 2025 cheatsheet

Was this page helpful?