You are viewing a single comment's thread from:
RE: Project Euler Problems for Learn Programming - Solution 1 (Python & Javascript)
Nice, I love these little coding challenges.
Here's a nice purely functional JavaScript solution to your problem:
[...new Array(1000).keys()].filter(num => {
return num % === 0 || num % 5 === 0;
}).reduce((all, current) => all + current):
Thanks for functional JS solution.
Cool that you are doing it with the new destructuring syntax. You created an instance of Array and applied the filter method.
Yeah I'm a big fan of some of those new ES6 features. It's so easy to turn all kinds of iterables into arrays and approaching them functionally.