Lesson 8 Dressed to impress. Help debug please


#1

var suitcase = {
shirt: "Hawaiian"
};
if(suitcase.hasOwnProperty('shorts')) {
console.log(suitcase.shorts);
};
else {
suitcase.shorts = "blue";
console.log(suitcase.shorts);
};

What am I doing wrong here?


#2

You get a error message:

SyntaxError: Unexpected token else

So than look near else and what can we see there?

if(){
};
else {
}

There is a ; before your else
Remove that and it works.


#3

thank you very much man