Below is a snippet taken from: https://stackoverflow.com/questions/7826992/browser-javascript-stack-size-limit
This version only works on es6 supporting runtimes, and is smaller, it also might be off by 1.
Can be useful to know recursion limitations.
let i = 0;
const inc = () => i++ && inc();
try {
inc();
} catch(e) {
console.log(i);
}