Description: Write a function that accepts a number n and print number one to n
function print(n) {
}
print(1);
// 1
print(3);
// 1
// 2
// 3
print(9);
// 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9
Answer:
function print(n) {
for (let i = 1; i <= n; i++) {
console.log(i);
}
}
print(1);
print(3);
print(9);
![[極短篇] 為什麼要用 IIFE](https://static.coderbridge.com/img/Lauviah0622/cc21804f5c20493895c0ef2af4e47edf.jpg)
![[2] 品質工程師,不只是測試](https://static.coderbridge.com/images/covers/default-post-cover-2.jpg)
