Skip to content

Instantly share code, notes, and snippets.

@jsmithdev
Created November 17, 2021 01:08
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 jsmithdev/3ab52a4e23be96acf5d3f7a40132e753 to your computer and use it in GitHub Desktop.
Save jsmithdev/3ab52a4e23be96acf5d3f7a40132e753 to your computer and use it in GitHub Desktop.
function dbl(x){
return x+x
}
Array.from(Array(30).keys())
.reduce((acc, curr, index) => {
acc = acc === 0 ? .01 : dbl(acc)
console.log('day ', index+1, ': $', acc)
return acc
}, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment