Skip to content

Instantly share code, notes, and snippets.

@jpetto
Created August 26, 2012 20:14
Show Gist options
  • Save jpetto/3483301 to your computer and use it in GitHub Desktop.
Save jpetto/3483301 to your computer and use it in GitHub Desktop.
JavaScript loops example
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