Created
June 10, 2009 10:17
-
-
Save aerith/127132 to your computer and use it in GitHub Desktop.
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 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