Or generate the range with the es6 spread operator:
.filter(n => n % 3 === 0 || n % 5 === 0)
.reduce((acc, n) => acc + n)
eval([...Array(1000).keys()].filter(n => n % 3 === 0 || n % 5 === 0).join('+'))
It's a bad practice to use eval, of course, but useful for JS code golf.
Or with lodash:
_(_.range(1, 1000)).filter(n => n % 3 === 0 || n % 5 === 0).sum()
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.