Answers for "how to repeat an array of objects n times in javascript"

0

how to repeat an array of objects n times in javascript

const makeRepeated = (arr, repeats) =>
  [].concat(...Array.from({ length: repeats }, () => arr));
  
console.log(makeRepeated([1, 2, 3], 2));
Posted by: Guest on March-18-2021

Code answers related to "how to repeat an array of objects n times in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language