EN
JavaScript - clone array
3
points
In this article, we would like to show you how to clone an array in JavaScript.
Quick solution:
// ONLINE-RUNNER:browser;
let letters = ['A', 'B', 'C'];
let copy = letters.slice();
console.log(letters);
console.log(copy);
Note: to see all approaches how to copy array check this article.