Skip to content

Instantly share code, notes, and snippets.

@tomcurran
Created January 2, 2014 23:53
Show Gist options
  • Save tomcurran/8229668 to your computer and use it in GitHub Desktop.
Save tomcurran/8229668 to your computer and use it in GitHub Desktop.
var svip = function(from, to) {
var total = 0;
for (var i = from; i <= to; i++) {
total += i;
if (i % 3 == 0 || i % 5 == 0) {
total += i;
}
}
return total;
}
console.log(svip(1, 1000));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment