String.prototype.repeat()
str.repeat(count);
count
: 문자열을 반복할 횟수, 0과 양의 무한대 사이의 정수Array.prototype.fill()
arr.fill(value[, start[, end]])
value
: 배열을 채울 값start
(optional) : 시작 인덱스, 기본 값은 0end
(optional) : 끝 인덱스, 기본 값은 this.length
Array(3).fill(1) === [1, 1, 1]
do ... while 문
...(생략)
do {
arr.push(n%10);
n = Math.floor(n/10);
} while (n>0);