Skip to content

Instantly share code, notes, and snippets.

@siddharthkrish
Last active May 30, 2017 07:19
Show Gist options
  • Save siddharthkrish/e830a918db9fd3ad401b0cfc28b9fb7a to your computer and use it in GitHub Desktop.
Save siddharthkrish/e830a918db9fd3ad401b0cfc28b9fb7a to your computer and use it in GitHub Desktop.
a possible way to define config variables for javascript
var CONFIG = (function() {
var private = {
'LANG': 'en_sg',
'HOPOFF_WAIT': '5'
};
return {
get: function(name) { return private[name]; }
};
})();
// usage
// CONFIG.get('LANG')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment