I have an array of the object users
.
"users" : [
{
fname: "subrato",
lname:"patnaik",
password:"123"
},
{
fname: "john",
lname:"doe",
password:"123"
}
]
I want to check whether the above JSON data contain the below object.
{fname:"subrato", password:"123"}
How could we do that in Javascript?
You're gonna need to loop through the array and do a check for it.