I have an array that contains a lot of objects that looks like this:
obj = {name: 'Hello', isUpdated:false};
Now, I wish to use lodash to assign all isUpdated variables from false to true.
I have been looking at their documentation and found:
_.assignIn(object, [sources])
However, I'm not quite sure it's what I needed. Maybe I need to combine two different methods?
I was hoping that some of you guys may know, thanks.
arr = arr.map(function(o) { o.isUpdated = true; return o; });arr.forEach(o => o.isUpdated = true);