Created
September 12, 2018 10:35
-
-
Save thedrint/646f1dfc795cc6fb58c37f69c35044dc 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
"use strict"; | |
class Something { | |
constructor (settings) { | |
let { | |
someoption = 'Default something value', | |
anotheroption = 0, | |
} = settings; | |
// Need to autofill object by known key names | |
let somethingSettings = { | |
someoption: someoption, | |
anotheroption: anotheroption, | |
}; | |
Object.assign(this, somethingSettings); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment