Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 643 Bytes

README.md

File metadata and controls

18 lines (13 loc) · 643 Bytes

3.3-Timers-Exercise

Timers Exercise

countdown

Write a function called countdown that accepts a number as a parameter and every 1000 milliseconds decrements the value and console.logs it. Once the value is 0 it should log “DONE!” and stop.

countDown(4);
// 3
// 2
// 1
// "DONE!"

randomGame

Write a function called randomGame that selects a random number between 0 and 1 every 1000 milliseconds and each time that a random number is picked, add 1 to a counter. If the number is greater than .75, stop the timer and console.log the number of tries it took before we found a number greater than .75.