added js version of problem 1
This commit is contained in:
parent
c83ec18a1e
commit
be5d7c1444
1 changed files with 8 additions and 0 deletions
8
1/euler001.js
Executable file
8
1/euler001.js
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/node
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
[...Array(999).keys()]
|
||||||
|
.filter( x => (x+1) % 3 == 0 || (x+1) % 5 == 0)
|
||||||
|
.reduce( (sum, x) => sum + x + 1)
|
||||||
|
+ 1
|
||||||
|
);
|
Reference in a new issue