Tell us what’s happening:
Describe your issue in detail here.
I think there’s something wrong with this question. There is no video to show the how-to-go-about and the example is very different from the main question. Anyone to add to what I hink?
I would like help on how to go about Your code so far
function checkObj(obj, checkProp) {
// Only change code below this line
return object.hasOwnProperty(checkProp);
// Only change code above this line
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Testing Objects for Properties
You are close to the answer, there’s needed one more change.
Similarly to how hasOwnProperty method is using checkProp - parameter passed to the function, the obj also needs to be used. obj is the object which should be tested if it has the specific property.
Where do they get that? I did not even input that?
Or should I make my own example like how they did here on this code below: checkForProperty({ top: 'hat', bottom: 'pants' }, 'top'); // true checkForProperty({ top: 'hat', bottom: 'pants' }, 'middle'); // false
When checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "gift") is called, the obj will be {gift: "pony", pet: "kitten", bed: "sleigh"}, and checkProp - "gift".