I have an object like this:
users = [{
"userid": "1",
"fornonmods": "<div id=\"user1\" data-login=\"\" data-status=\"online\" class=\"item\">",
"formods": "<div id=\"user1\" data-login=\"\" data-status=\"online\" class=\"item\">"
}, {
"userid": "19917",
"fornonmods": "<div id=\"user19917\" data-login=\"kBr4pelyDy4yKVmiAAAD\" data-status=\"online\" class=\"item\">",
"formods": "<div id=\"user19917\" data-login=\"kBr4pelyDy4yKVmiAAAD\" data-status=\"online\" class=\"item\">"
}];
I want to replace all the occurrences of
data-login=\"kBr4pelyDy4yKVmiAAAD\" data-status=\"online\"
with
data-login=\"kBr4pelyDy4yKVmiAAAD\" data-status=\"gagged\"
just like I would do with replace() but the thing is that that only works with strings and I am not allowed to convert this object into a string.
What can I do in this cases?
.fornonmodsproperty of the objects in the array. You know how to iterate an array?