const newArr = arr.map((n, i) => n.repeat(i + 1));
const newArr = arr.map((n, i) => Array(i + 1).fill(n).join(''));
const newArr = arr.map((n, i) => Array(i + 2).join(n));
const newArr = [];
for (let i = 0; i < arr.length; i++) {
let str = '';
for (let j = 0; j <= i; j++) {
str += arr[i];
}
newArr.push(str);
}
const newArr = [];
for (const n of arr) {
let str = '';
while ((str = str.concat(n)).length <= newArr.length) ;
newArr[newArr.length] = str;
}
const wait = time => new Promise(r => setTimeout(r, time));
wait(1000)
.then(() => { console.log(1); return wait(1000); })
.then(() => { console.log(2); return wait(1000); })
.then(() => { console.log(3); });
// или
[ 1, 2, 3 ].reduce((promise, n) => promise
.then(() => wait(1000))
.then(() => console.log(n))
, Promise.resolve());