javascript check value exists on 3rd level array of objects code example
Example: react array if id is present do not add element
addPerson = (person) => {
let filteredPerson = this.state.likes.filter(like => like.name !== person.name);
this.setState({
likes: [...filteredPerson, person]
})
}