Iterations JS Homework
Practice problems for iterations
- 3.8 Iterations Homework 🔄
- 📌 Problem 1: Fill in the Blank 📝
- 🚀 Problem 2: Create Your Own Loop
3.8 Iterations Homework 🔄
Complete the following problems to practice your iteration skills!
📌 Problem 1: Fill in the Blank 📝
Complete the code below to make it print all numbers from 1 to 10.
Expected output: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
%%javascript
// Fill in the blanks to complete the loop
for (let i = ___; i <= ___; ___) {
console.log(i);
}
🚀 Problem 2: Create Your Own Loop
Write a program that uses a while loop to print "Hello!" 5 times.
Expected output:
Hello!
Hello!
Hello!
Hello!
Hello!
%%javascript
// YOUR CODE HERE
// Submit through the Link in Announcements