In JavaScript:
var total = 0; for (var i = 0; i < 1000; i++){ if ((i % 3 === 0) || (i % 5 === 0)){ total += i; } } document.write(total);
on GitHub