const secondArray = [1, 2, 3].reduce((acc, item) => { acc.push(1); return acc; }, []); console.log(secondArray);