Given an object
var myObject = {
label: 'foo',
name: 'bar',
id: 12
},
If I wanted to change multiple values, I would do the following:
myObject.label = "bar";
myObject.name = "foo";
When updating large sets of data, it makes the code quite blocky. Is there a way to do this in a more concise manner?
Like:
myObject.({label: 'foo'}, {name: 'bar'});