Created
December 31, 2017 10:01
-
-
Save thamizhchelvan/245821c8a877ec25c36bcac6cb1de15d to your computer and use it in GitHub Desktop.
Count the number of call stack
This file contains 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
'use strict'; | |
function countCallStack(){ | |
try{ | |
return 1 + countCallStack(); | |
} | |
catch(error){ | |
return 1; | |
} | |
} | |
var total = countCallStack(); | |
console.log(total); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment