Skip to content

advance JS solution of the keyowrd 'this' exercise. #43

@ajay1008

Description

@ajay1008

Hy there, Thank you such a wonderful handson Tutorials, I am in Love with RITHM School Tutorials now.

I was stuck in a exercise though, the snipet for the tutorials on keyowrd 'this', which is given, as below:

var instructor = {
firstName: 'Tim',

info: {

    catOwner: true,

    boatOwner: true,

    displayLocation: function(){

        return this.location;

    },

    data: {

        location: "Oakland",

        logLocation: this.displayLocation

    }

},

}

instructor.info.data.logLocation() // Why might we be getting an error here?

can anyone explain me this, and also the solution for the same. ?


Regards,
Ajay. R

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions