Created
October 11, 2013 09:37
-
-
Save joladev/6932140 to your computer and use it in GitHub Desktop.
Some Euler problem
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
function solution(number){ | |
var range = function (max) { | |
var nums = []; | |
for (var i = 0; i < max; i++) { | |
nums.push(i); | |
} | |
return nums; | |
}; | |
return range(number) | |
.filter(function (x) { | |
return x % 3 && x % 5 ? 0 : x; | |
}) | |
.reduce(function (acc, x) { | |
return acc + x; | |
}, 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment