Skip to content

Instantly share code, notes, and snippets.

@santaclauze
Created March 13, 2018 01:17
Show Gist options
  • Save santaclauze/8e508d71b16054b3f72e5e1fcffef307 to your computer and use it in GitHub Desktop.
Save santaclauze/8e508d71b16054b3f72e5e1fcffef307 to your computer and use it in GitHub Desktop.
object.js
componentThemes = [A, B];
bsComponents = {a: { test: true }, b: { test: true }, c: { test: false }, d: { test: true }};
for (let i = 0; componentThemes.length > i; i++) {
for (const key in bsComponents) {
if (key === componentThemes[i].toLowerCase()) {
filteredTheme = Object.assign({}, bsComponents[key].defaultProps.theme);
}
}
}
console.log(filteredTheme)
expectedRestul = {
test: true
test: false}
actualResult = {
test: false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment