Perbarui properti di objek di array javascript
var result = foo.map(el => el.bar == 1 ? {...el, baz: [11,22,33]} : el);
Mohamed Mahfouz
var result = foo.map(el => el.bar == 1 ? {...el, baz: [11,22,33]} : el);