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