Skip to content

Instantly share code, notes, and snippets.

@xiaoyunyang
Last active January 25, 2018 09:06
Show Gist options
  • Save xiaoyunyang/975e206b096fdb97584702c81e4ee55c to your computer and use it in GitHub Desktop.
Save xiaoyunyang/975e206b096fdb97584702c81e4ee55c to your computer and use it in GitHub Desktop.
Closure With Recursion
num = 0
var myFun2 = function() { 
var num = -1
incrementUntil(3)
return num 
}
myFun2() //> -1 ……Why?
num //> 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment