8 dressed to impress


#1

var suitcase = {
shirt: "Hawaiian"
};

if (suitcase.hasOwnProperty('shorts')) {
console.log(suitcase.shorts);
} else {
var suitcase.shorts = "red hearts"
console.log(suitcase.shorts)
};

I need a pair of fresh eyes. I can't see the error I am making


#2

Remove var from this statement.


#3

@webmaster34593

Try it by using

suitcase.shorts = "red hearts";

as you are modifying/extending the suitcase object


#8