Created
July 31, 2017 01:01
-
-
Save prof3ssorSt3v3/01c9e7e0edca93bfde5681df6cd3891a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// While loops | |
// | |
// while(condition){ | |
// statements | |
// } | |
// | |
// do{ | |
// statements | |
// }while(condition) | |
let total = 30; | |
while( total < 30){ | |
total += Math.floor(Math.random() * 5) + 1; | |
console.log('while', total); | |
} | |
do{ | |
total += Math.floor(Math.random() * 5) + 1; | |
console.log('do', total); | |
}while( total < 30) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment