I have JavaScript object:
myData = {
items: [
{
flag: false,
text: "good text"
},
{
flag: true,
text: "good text"
},
{
flag: false,
text: "good text"
}
]
}
How can I change text everywhere where flag = true.
For example only 2nd object need to be changed from "good text" to "bad text", because only this object in my example has flag = true.
I want to do this using Lodash in JavaScript.