Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created Aug 7, 2016
Embed
What would you like to do?
Codecademy export
var suitcase = {
shirt: "Hawaiian"
};
if (!suitcase.hasOwnProperty('shorts')) {
suitcase.shorts = "red";
console.log(suitcase.shorts)
}
// We check to see if the suitcase property DOESN'T have a // property & and we create and print that property
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment