Skip to content

Instantly share code, notes, and snippets.

@joladev
Created October 11, 2013 09:37
Show Gist options
  • Save joladev/6932140 to your computer and use it in GitHub Desktop.
Save joladev/6932140 to your computer and use it in GitHub Desktop.
Some Euler problem
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