8/30 Print value of the Shorts


#1

This is my codes, but i don't know how to print the value of the Shorts when if is returning true

var suitcase = {
    shirt: "Hawaiian"
};

if  (suitcase.hasOwnProperty("short"))  { 
    // how to print
}
else { 
    return suitcase.shorts = "red";
}

thanks


#2

Note the spelling...

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