Skip to content

Instantly share code, notes, and snippets.

@thedrint
Created September 12, 2018 10:35
Show Gist options
  • Save thedrint/646f1dfc795cc6fb58c37f69c35044dc to your computer and use it in GitHub Desktop.
Save thedrint/646f1dfc795cc6fb58c37f69c35044dc to your computer and use it in GitHub Desktop.
"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