Last active
December 22, 2019 13:09
-
-
Save dsetzer/d65158ed4f78772c7c4d0748f4a178f7 to your computer and use it in GitHub Desktop.
Making config values easier to work with
This file contains hidden or 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 config = { | |
baseBet: { type: 'balance', label: 'Base Bet', value: 100 } | |
}; | |
// Add config values to global scope | |
Object.entries(config).forEach(c=>window[c[0]]=c[1].value); | |
// Before: | |
//await this.log(config.baseBet.value); | |
// After: | |
// await this.log(baseBet); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment