Last active
September 27, 2016 05:45
-
-
Save AbdallaZaki/9d702f7cacc24c6a5a0ee7b74ed5c8f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://projecteuler.net/problem=1 | |
var getSumOfMuliples = function (n1,n2,limit){ | |
var result=0; | |
for(var i=Math.min(n1,n2);i<limit;i++){ | |
if(i%n1==0||i%n2==0){ | |
result+=i; | |
} | |
} | |
return result; | |
} | |
console.log(getSumOfMuliples(3,5,1000)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment