Skip to content

Instantly share code, notes, and snippets.

@Ben52
Created July 26, 2016 01:33
Show Gist options
  • Save Ben52/c355ad444000e35e70dd199e41333f1f to your computer and use it in GitHub Desktop.
Save Ben52/c355ad444000e35e70dd199e41333f1f to your computer and use it in GitHub Desktop.
simple fibonacci function
function fb(steps, series = [], current = 1, last = 0) {
if(steps === 0) return series.reduce((a, b) => a + b);
return fb(--steps, series.concat(current), current + last, current)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment