Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 973 Bytes

File metadata and controls

19 lines (11 loc) · 973 Bytes

JavaScript Loops and Timer Events Lecture

While/For Loop Practice 1:

  • Create an empty name_array
  • Ask the user Enter a word. Enter 'q' to quit. Add each word they enter to the array
  • Create a while loop that will keep asking for words to add to the array until they enter 'q'
  • When the user enters 'q' use a for loop to print each word from the array
  • NOTE: Your code should handle the case of the entered quit letter Q

Timer Practice 1: One off timer

Write the JavaScript code to display BREAK OFF THE ATTACK! Their shields are still up! then after 3 seconds (3000 ms) in the console display IT'S A TRAP! using a one off timer.

Timer Practice 2: Repeating timer

Write the HTML code so that you have one button that says Hush Ya'll. Write the JavaScript code to nag the user every 5 seconds with a message of Well... We're waiting!!! until you click the button. Clicking the button will stop the nage messages in the console.