For an array of objects, it's impossible to use indexOf unless you specify the full object. Should implement a new indexOf that supports both arrays of values and arrays of objects.
Might also consider a flag to return the first element rather than searching the entire array.
For an array of objects, it's impossible to use indexOf unless you specify the full object. Should implement a new indexOf that supports both arrays of values and arrays of objects.
Might also consider a flag to return the first element rather than searching the entire array.