30 Javascript Find Index Of Object In Array

Here, the if condition is testing if any object in the array is available with id and name equal to the given object. If fo…