Skip to main content

Recursionfunction to call itself from its implementation body

aka Recursive, Recusively, Recursive-Function

RangeError

Mutual Recursion

Design Pattern for two functions to Recusively call each other

References

  1. Recursive Route ↔ use Nested Routes with /* path to set up nested link within <Route\> & allow it to return new <Route\> for Recursion

  2. Fibonacci Recursive ↔ assume sequence starts with 1. Example of BAD Recursive fn. Traverse down Fibonacci Tree until reach 1

function fibonacci(index: number) { 
if(index <= 1) return 1
return fibonacci(index-1) + fibonacci(index-2)
}
  1. Mutual RecursionDesign Pattern for two functions to Recusively call each other