8. Dressed to Impress


#1

Hi guys,

Can someone please tell me wher i'm going wrong?

I get the following error:

Oops, try again. Use suitcase.hasOwnProperty("shorts") to check the property!

Here's my code:

var suitcase = {
shirt: "Hawaiian"
};

if (suitcase.hasOwnPropery ("shorts") ) {
console.log(shorts);
} else {
suitcase.shorts = "red";
console.log(shorts);
};


#2

Hi this line

if (suitcase.hasOwnPropery ("shorts")

you wrote hasOwnPropery instead of hasOwnProperty


#3

Haha.. thanks bro :slight_smile: