Skip to content

Instantly share code, notes, and snippets.

@nainglinaung
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nainglinaung/1a7f454e84d4990abd62 to your computer and use it in GitHub Desktop.
Save nainglinaung/1a7f454e84d4990abd62 to your computer and use it in GitHub Desktop.
The sum of number less than 1000 which is divisible by 3 or 5
console.log(Array.apply(null, Array(1000)).map((_, i)=>i+1).filter(v=> v%5==0||v%3==0).reduce((a,b)=>a+b));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment