newDesign = {
    color: 'blue',
    shape: 'round'
}
oldDesign = {
    color: 'yellow',
    shape: 'triangle'
}
I want to compare this two design to see if their field is changed, so I write these:
fields = [ 'color', 'shape' ]
for (let field in fields) {
    if (oldDesign.field !== newDesign.field)
        console.log('changed')
}
However, looks like I can't read the value of fields by using oldDesign.field.
Is there a way to to this? Thank you.
 
    