YALA
#1
Tell us what’s happening:
Your code so far
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
myObj.house = "house";
function checkObj(checkProp) {
// Only change code below this line
if(myObj.hasOwnProperty(checkProp)==true){
return myObj[checkProp];
}else{
return "Not found"
}
// Only change code above this line
}
checkObj("gift");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
.
Challenge: Testing Objects for Properties
Link to the challenge:
Sky020
#2
Do you have a question?
If so, please edit you post to include it in the Tell us what’s happening section.
The more information you give us the more likely we are to be able to help.
Well as it should do a boolean comparison it either return true or false
ilenia
#5
you are returning "Not found"
, there is a difference
1 Like
YALA
#6
yes,u gotta me i have to pay attention before run a code
now it’s ok.