2019/05/08

How javascript prefers a "while loop" to a beautiful recursive algorithm





As it's explained here, most browsers will barf on "too much recursion". Here's an entry in the V8 bug tracker that is interesting reading.

If it's simple self-recursion, it's probably better to use explicit iteration rather than hoping for tail-call elimination.

Even if i prefer definitely the beauty of recursion :)