JavaScript 2025 · Arrays
Copy an array
Make a shallow copy with spread.
const copy = [...items];
Official JavaScript 2025 documentation
JavaScript 2025 · Arrays
Make a shallow copy with spread.
const copy = [...items];
Official JavaScript 2025 documentation
Was this page helpful?