Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript duplicate an array

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

// older method
const duplicate = Array.from(arr);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #duplicate #array
ADD COMMENT
Topic
Name
4+5 =