Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 1.23 KB

File metadata and controls

24 lines (16 loc) · 1.23 KB

JavaScript Loops and Timer Events - ic

Exercise 1: Loop

Use a for loop to print numbers -3 through 8.

Exercise 2: Loop

Use a for loop to count from -5 to 5 three times in a row.

Exercise 3: Loop

Use a for loop to print only even numbers from -50 to 50.

Exercise 4: Loop

Use a for loop to print from 0 to 50. Once it gets to 10, print "TEN!!!" instead of the number.

Exercise 5: Loop

Prompt the user to enter a number. Prompt the user to enter another number. Create a for loop that counts from the first number to the second number.

Exercise 6: Loop

Create a hardcoded/fixed password. Create a loop that will ask the user to enter a password until it matches the hardcoded password. Once they match alert the user THAT’S CORRECT!!! Keep asking the user until they get the right password.

NOTE: Your code should handle the password regardless of the case (upper or lower).

Exercise 6: Repeating timer

Create a button with the text Start Countdown!. When the User clicks the button, display a countdown sequence in the browser as an <h2> from 10 to LIFTOFF!!. Display each number during the countdown each second (1000 ms), leading up to the word LIFTOFF!!!. Be sure to stop the timer once liftoff achieved.