Created
June 16, 2012 17:17
-
-
Save cocodrino/2941992 to your computer and use it in GitHub Desktop.
code blog --clausuras part1
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
var aumentar_valor = function(x){ | |
var numero = x; | |
return function(){ | |
return numero+=1; | |
}; | |
}; | |
var add_user = aumentar_valor(0); | |
console.log(add_user()); | |
console.log(add_user()); | |
console.log(add_user()); | |
//imprime | |
1 | |
2 | |
3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment