How to call below function and my expected output is "Hi John, my name is James"
function Person(name){
this.name = name;
}
Person.prototype.greet = function(otherName){
return "Hi " + otherName + ", my name is " + name; // not working
}
name is not defined in above code.