Skip to content

Instantly share code, notes, and snippets.

@aerith
Created June 10, 2009 10:17
Show Gist options
  • Save aerith/127132 to your computer and use it in GitHub Desktop.
Save aerith/127132 to your computer and use it in GitHub Desktop.
var Pool = function (name, value) {
var self = arguments.callee;
if ( typeof self.stash == "undefined" ) self.stash = {};
if ( Boolean(name) === false ) return false;
var item = self.stash[name];
if ( typeof value == "undefined" ) delete self.stash[name];
if (value) self.stash[name] = value;
return item;
};
Pool('aaaa', 'aaaaa');
alert(Pool('aaaa'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment