const makeRepeated = (arr, repeats) => Array.from({ length: repeats }, () => arr).flat(); console.log(makeRepeated([1, 2, 3], 2));