var result = foo.map(el => el.bar == 1 ? {...el, baz: [11,22,33]} : el);
//change in array itself without need to another one
arr.map(el =>{ el.bar == 1 && el.baz--} ); // don't forget {} in arrow function
foo.forEach(function(obj) {
if (obj.bar === 1) {
obj.baz[0] = 11;
obj.baz[1] = 22;
obj.baz[2] = 33;
// Or: `obj.baz = [11, 22, 33];`
}
});