Skip to content

Instantly share code, notes, and snippets.

@vladanyes
Last active July 16, 2019 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladanyes/5cade2ca9011471d26674b5249294f20 to your computer and use it in GitHub Desktop.
Save vladanyes/5cade2ca9011471d26674b5249294f20 to your computer and use it in GitHub Desktop.
JavaScript stack size check
// Each boolean and number variable takes 8 bytes of memory.
var counter = 0;
try {
function foo() {
counter += 1;
foo();
}
foo();
} catch(e) {
console.error(e);
console.log('counter =', counter);
}
// https://glebbahmutov.com/blog/javascript-stack-size/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment