Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript copy an array

let arr =["a","b","c"];
// ES6 way
const copy = [...arr];

// older method
const copy = Array.from(arr);
 
PREVIOUS NEXT
Tagged: #javascript #copy #array
ADD COMMENT
Topic
Name
4+2 =