x * i 를 해서 배열 안에 넣으면 되겠다!
반복문에 들어가는 조건...
n.length가 아니라 n으로 해야겠다!
function solution(x, n) {
let arr = [];
for(i = 1; i <= n; i++){
arr.push(x*i)
}
return arr
}
function solution(x, n) {
return Array(n).fill(x).map((v, i) => (i + 1) * v)
}
이게 머야...
Array(n)
fill(x)
map =>