This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
project-euler/e0001/euler0001.js

9 lines
166 B
JavaScript
Raw Normal View History

2017-07-04 00:13:17 +02:00
#!/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
);