Finding a certain object in an array
Given both an array of objects and an input, search for an object that contains the input. Return that particular object.
Sample Code:
function findObj(arr,inp) {
// Enter your logic here...
}
Examples:
Input: [{id:'2'},{id:2}],2
Output: {id:2}
Explanation: Object {id:2} has a value of 2.
Input: [{id:'2'},{id:2}],'2'
Output: {id:'2'}
Explanation: Object {id:'2'} has a value of '2'.