Tableau de clone JS
const clone1 = [...array]
const clone2 = new Array(...array)
florinrelea
const clone1 = [...array]
const clone2 = new Array(...array)
const sheeps = ['Apple', 'Banana', 'Juice'];
// Old way
const cloneSheeps = sheeps.slice();
// ES6 way
const cloneSheepsES6 = [...sheeps];
numbers = [1, 2, 3];
numbersCopy = Array.from(numbers);
// [1, 2, 3]
let arr =["a","b","c"];
// ES6 way
const duplicate = [...arr];
// older method
const duplicate = Array.from(arr);
let clone = myArray.concat();