Created
August 26, 2012 20:14
-
-
Save jpetto/3483301 to your computer and use it in GitHub Desktop.
JavaScript loops example
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
var coffees = ['Ethiopia', 'Rwanda', 'Burundia', 'Kenya', 'Tanzania']; | |
for (var i = 0; i < coffees.length; i++) { | |
console.log(coffees[i]); | |
} | |
var pip = Number(prompt("What was Pippen's jersey number?")); | |
while (pip !== 33) { | |
alert("Wrong!"); | |
pip = Number(prompt("What was Pippen's jersey number?")); | |
} | |
var points; | |
do { | |
points = Number(prompt("How many points on each star of the Chicago flag?")); | |
} while (points !== 6); | |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment