Dressed to Impress


So in the instructions, Codacademy references this:

Recall that obj.hasOwnProperty('propertyName') will return true or false based on whether or not obj has the >propertyName property.

When am I supposed to recall this from? This is the first time I have seen this property!

This kind of thing drives me crazy!


There is a first time for everything. Relish in it. Look back on it and learn from it.

    var obj = {
        foo: "me a foo",
        bar: "me a bar"
    var foo = obj.hasOwnProperty('foo')
    if (foo) {
    var bar = obj.hasOwnProperty('bar')
    if (bar) {


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.