I am having difficulty understanding this line of code on addHobby: function (new_hobby) { this.hobby.push(new_hobby);} What does the this.hobby referring to? is it referring to the parameter passed in and also how is the execution of code would be? and the final result after the function is done. What data would be displayed at addHobby.
Thanks so much if you could help me.
const user = {
name: "Mary",
age: 26,
hobby: ["swimming", "badminton"],
isMarried: false,
addHobby: function (new_hobby) {
this.hobby.push(new_hobby);
}
};