Errors: Too Much Recursion - JavaScript - W3cubDocs
and both require a condition (to avoid an infinite loop, or rather, infinite recursion in this case). When there are too many function calls, or a function is missing a base case, JavaScript will throw this error.