DEV Community

Discussion on: Recursion in daily programming!

Collapse
 
sargalias profile image
Spyros Argalias

I like the article, but I just wanted to add that we need to be careful when using recursion for maths in JavaScript.

Browsers don't currently have tail-call optimisation, which means we'll get the Uncaught RangeError: Maximum call stack size exceeded if the stack grows too large due to recursion.

But other than math, recursion should be fine.

Collapse
 
karthikeyan676 profile image
Karthikeyan

Exactly, I faced the same problem before in react application. I'll add it in this post. Thanks for the mention.