Skip to content

Instantly share code, notes, and snippets.

@alpox
Created December 21, 2017 16:29
Show Gist options
  • Save alpox/2f28ea3b66b2b7d86a84aedd44c1edc7 to your computer and use it in GitHub Desktop.
Save alpox/2f28ea3b66b2b7d86a84aedd44c1edc7 to your computer and use it in GitHub Desktop.
const sumFibs=(num)=>(fib=((s,l=0,n=1,m=0)=>(n%2?n<=s&&(m+=n)&&0:0)||n>s?m:fib(s,n,l+n,m)))(num);
sumFibs(1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment