I have the following situation:
function dog()
{
this.name = 'Lumpy';
this.getName = function() {
return this.name;
}
}
function show_dog_name(dogname)
{
alert(dogname());
}
bigdog = new dog();
show_dog_name(bigdog.getName);
“this” not refers to “dog” object so how get parent object in passed function.
1 Answer