Skip to content

Instantly share code, notes, and snippets.

@zoolu-got-rhythm
Created January 11, 2016 22:13
Show Gist options
  • Save zoolu-got-rhythm/60661dbde8a4188dd4a1 to your computer and use it in GitHub Desktop.
Save zoolu-got-rhythm/60661dbde8a4188dd4a1 to your computer and use it in GitHub Desktop.
var myNumber = 1;
function recur(n){
console.log("call stack is " + n);
n++;
n < 10 ? recur(n) : console.log("pop");
}
recur(myNumber); // only the passed number get's changed
console.log(myNumber); // the var in global scope doesn't get mutated?
@zoolu-got-rhythm
Copy link
Author

parsed*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment