Skip to content

Instantly share code, notes, and snippets.

@pancurster
Created August 1, 2012 22:04
Show Gist options
  • Save pancurster/3231110 to your computer and use it in GitHub Desktop.
Save pancurster/3231110 to your computer and use it in GitHub Desktop.
Domknięcia w JS
var foo = function() {
if (typeof foo.i == 'undefined') {
foo.i = 0;
}
++foo.i;
return [ function() {
return --foo.i;
},
function() {
return ++foo.i;
},
function() {
return foo.i;
}
];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment