Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var name = 'Hoang';
var obj = {
name: 'Alibaba',
prop: {
name: 'Aladin',
getName: function() {
return this.name;
}
}
};
console.log(obj.prop.getName());
var test = obj.prop.getName;
console.log(test());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment