Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kendhia/1870126 to your computer and use it in GitHub Desktop.
Save kendhia/1870126 to your computer and use it in GitHub Desktop.
The solution of the first problem in "Project Euler" using JavaScript !
var max = 1000;
var result = 0;
function TheSum() {
for (i = 0; i<max; i++) {
if (i % 3 === 0 || i % 5 === 0) {
result += i;
console.log(result) ;
}
}
}
TheSum();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment