Skip to content

Instantly share code, notes, and snippets.

@cocodrino
Created June 16, 2012 17:19
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 cocodrino/2941999 to your computer and use it in GitHub Desktop.
Save cocodrino/2941999 to your computer and use it in GitHub Desktop.
code blog - clausuras 2
//al llamar
var add_user = aumentar_valor(0);
//tenemos
var add_user = function(0){ //sustituyendo x por 0
var numero = x;
return function(){
return numero+=1;
};
};
hasta aqui todo simple..ahora veamos que sucede...
var add_user =
var numero = 0;
return function(){
return numero+=1;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment