I have array of objects. I want to find the value in key which matches the word and if it's there it should return me true in console otherwise false.
I have array of objects like this:
[
{
"groupName": "harry",
},
{
"groupName": "mike",
}
]
And I want to match this key groupName with value like Amy. As we can see Amy in not there in groupName so it should return me false in console otherwise true if any of the groupName value is Amy.
How to achieve this using Javascript?
useStateto fire up a action. Otherwise if it is false then I would show alert in that. I just need the concept of matching it with the given word. That's it. Otherwise it would be lengthy question and answer to be asked.