I am following a tutorial on Codecademy and it says
unexpected token {
What is the error here please?
This is what I need to do
Write an if statement that checks to see if suitcase has the shorts property.
If your if statement evaluates to true, print the value of the shorts property.
If your if statement evaluates to false, set the shorts property to any value you wish using dot notation. Then print the value of the shorts property.
var suitcase = {
shirt: "Hawaiian"
};
if (suitcase.hasOwnProperty("shorts") {
console.log(suitcase.shorts)
} else if (suitcase.hasOwnProperty != ("shorts")) {
suitcase = {
shorts: "tailormade"
};
console.log(suitcase.shorts);
}
}
if(suitcase.hasOwnProperty("shorts"){. You have not closed the parenthesis.if(suitcase.hasOwnProperty!=("shorts")you should remove!=