Find limit of recursion is part of Short Circuit's Console Program Basics selection.
Task

Find the limit of recursion.




def recurse;
recurse = {
    try {
        recurse (it + 1)
    } catch (StackOverflowError e) {
        return it
    }
}
 
recurse(0)