You are viewing a single comment's thread from:

RE: Project Euler Problems for Learn Programming - Solution 1 (Python & Javascript)

in #javascript8 years ago

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):
Sort:  

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.

Coin Marketplace

STEEM 0.13
TRX 0.33
JST 0.034
BTC 111229.43
ETH 4289.18
SBD 0.83