Created
January 26, 2015 23:10
-
-
Save ben-bradley/d6e49edc156013ec8b85 to your computer and use it in GitHub Desktop.
javascript callstack check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.2ality.com/2014/04/call-stack-size.html | |
function computeMaxCallStackSize() { | |
try { | |
return 1 + computeMaxCallStackSize(); | |
} catch (e) { | |
// Call stack overflow | |
return 1; | |
} | |
} | |
console.log(computeMaxCallStackSize()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment