8. Dressed to Impress - *need code check*


I'm getting the message "ReferenceError: shorts is not defined." What's not quite right here? Thanks.

var suitcase = {
shirt: "Hawaiian"

if (suitcase.hasOwnProperty(shorts) === true) {
} else {
suitcase.shorts = "blue";



on this line

it should rather be

if (suitcase.hasOwnProperty('shorts') === true) {

but since suitcase.hasOwnProperty('shorts') will return a boolean value you can just write

if (suitcase.hasOwnProperty('shorts')) {


First of all you didnt understand how to check if an object has a property. This is not how you check if an object has a property:

I am not going to give you exact anwser but an example so you can implement it to your code


Hope this helped!


@amanuel2 thank you! and happy birthday


@rydan thanks! totally forgot about the quotes


Thankyou so much!!!!