Lesson 8.Dressed to impress


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>
Hello.Code works but shouldn’t it print ‘false’ instead of ‘blue?’

```

var suitcase = {
shirt: “Hawaiian”
};

if (suitcase.hasOwnProperty(‘shorts’)) {
console.log(suitcase.shorts);
} else {
suitcase.shorts = ‘blue’;
console.log(suitcase.shorts);
};

<do not remove the three backticks above>

#2

No, it should print the value of the shorts property, which is in your code blue


#3

As I understood, in ‘else’ branch we add the new property ‘shorts’ to our object ‘suitcase’, and set it value to string blue (in your case). Then we just logged it to console.