FCC: Testing Objects for Properties


Modify the function checkObj to test myObj for checkProp. If the property is found, return that property’s value. If not, return "Not Found".




  • .hasOwnProperty(propname)method of objects to determine if that object has the given property name.
  • .hasOwnProperty()returnstrueorfalseif the property is found or not.
  • use ‘===’ to check for true or false.
  • To return value of a property in a lookup table:  lookupTable[property];
FCC: Testing Objects for Properties

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s