Find limit of recursion: Difference between revisions
Content added Content deleted
m (→{{header|Icon}} and {{header|Unicon}}: -workswith) |
|||
Line 449: | Line 449: | ||
=={{header|JavaScript}}== |
=={{header|JavaScript}}== |
||
<lang javascript> |
<lang javascript> |
||
function recurse(depth) |
function recurse(depth) |
||
{ |
|||
try |
try |
||
⚫ | |||
{ |
|||
⚫ | |||
return recurse(depth + 1); |
|||
} |
} |
||
⚫ | |||
{ |
|||
⚫ | |||
} |
|||
} |
} |
||
maxRecursion = recurse(1); |
var maxRecursion = recurse(1); |
||
document.write( |
document.write("Recursion depth on this system is " + maxRecursion);</lang> |
||
</lang> |
|||
Sample output (Chrome): |
Sample output (Chrome): |