Skip to content

Instantly share code, notes, and snippets.

@jason-s13r
Created November 7, 2012 01:30
Show Gist options
  • Save jason-s13r/4028984 to your computer and use it in GitHub Desktop.
Save jason-s13r/4028984 to your computer and use it in GitHub Desktop.
@js gist: loading test.
self.Constants = function () {
var _constants = {};
return {
get: function (name) {
return _constants[name];
},
add: function (name, value) {
if(typeof _constants[name] != "undefined") {
return value;
}
_constants[name] = value;
return _constants[name] == value;
},
del: function (name) {
return delete _constants[name];
},
all: function () {
return _constants;
}
};
};
self.constant = Constants();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment