Answers for "js make duplicates"

1

javascript create array with repeated values

Array(5).fill(2)
//=> [2, 2, 2, 2, 2]
Posted by: Guest on February-17-2021
8

javascript duplicate an array

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

// older method
const duplicate = Array.from(arr);
Posted by: Guest on July-02-2020

Code answers related to "js make duplicates"

Code answers related to "Javascript"

Browse Popular Code Answers by Language