I want to add multiple attributes to an existing object with existing attributes. Is there a more concise way than one line per new attribute?
myObject.name
In ES6/ ES2015 you can use the Object.assign method
let obj = {key1: true}; console.log('old obj: ', obj); let newObj = {key2: false, key3: false}; Object.assign(obj, newObj); console.log('modified obj: ', obj);