Determine if the Object Key exists
The given parameters are Object and key. The function will return true if the key is found in the object. Otherwise return false.
Sample Code:
function inspectObj(obj,prop) {
// Enter your logic here...
}
Examples:
Input: {ingredient:'Javascript'},'ingredient'
Output: true
Explanation: The object has a property called 'ingredient'.
Input: {tool:'Javascript'},'ingredient'
Output: false
Explanation: 'ingredient' property cannot be found in the given object.