Recursion

Here we go, climbing up the sum tree
Adding numbers from one up to infinity or
Well, the limit! function calculate sum limit
If we've reached one, we're done, it's true
Return limit base case, nothing left to do

Otherwise, let's keep adding on
Return limit calculate sum, limit
Return limit calculate sum, limit
Recursive call, bring the sum along
Recursive call, bring the sum along

Example usage let's see the grand total
Const limit equals ten
Console log sum of numbers up to limit, limit
Calculate sum, limit
Show me the money, the sum so sweet

And here's the chorus, loud and clear
Add it up, one by one
Recursion makes the math more fun
From limit to one
In numbers we trust
Stack those calls if you must

Limit!

If we've reached one, we're done, it's true
If we've reached one, we're done, it's true
If we've reached one, we're done, it's true
Return limit base case, nothing left to do

Otherwise, let's keep adding on
Return limit calculate sum, limit
Recursive call, bring the sum along
Recursive call, bring the sum along
Recursive call, bring the sum along

Example usage let's see the grand total
Const limit equals ten
Console log sum of numbers up to limit, limit
Calculate sum, limit
Show me the money, the sum so sweet

And here's the chorus, the sum so sweet
And here's the chorus, loud and clear
Add it up, one by one
Recursion makes the math more fun
From limit to one
In numbers we trust
Stack those calls if you must

Limit, limit, must limit, you must limit
Show me the money the sum so sweet
And here's the chorus, loud and clear
Add it up, one by one
Recursion makes the math more fun
From limit to one
In numbers we trust
Stack those calls if you must

Limit



Credits
Writer(s): Serdar Temel
Lyrics powered by www.musixmatch.com

Link