Skip to content

Instantly share code, notes, and snippets.

@rgaz1962
Created January 1, 2017 21:47
Show Gist options
  • Save rgaz1962/531dd9e835a366a089d3c2351f4e710a to your computer and use it in GitHub Desktop.
Save rgaz1962/531dd9e835a366a089d3c2351f4e710a to your computer and use it in GitHub Desktop.
XNqPzr
var sum = 0;
var number = 1;
while (number <= 50) { // -- condition
sum += number; // -- body
number++; // -- updater
}
alert("Sum = " + sum); // => Sum = 1275
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment