Skip to content

Instantly share code, notes, and snippets.

@xulapp
Created September 12, 2010 11:07
Show Gist options
  • Save xulapp/575988 to your computer and use it in GitHub Desktop.
Save xulapp/575988 to your computer and use it in GitHub Desktop.
storage
var store = (function() {
var keys = [];
var values = [];
return function store(key, value) {
var index = keys.indexOf(key);
if (1 < arguments.length) {
if (index === -1)
index = keys.push(key) - 1;
values[index] = value;
}
return values[index];
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment