This is what I have:
var Person = function(fname, lname) {
this.fname = fname;
this.lname = lname;
};
Person.prototype = {
getFullName: function() {
return this.fname + " " + this.lname;
},
doStuff: function(stuff) {
return stuff();
}
};
var john = new Person("John", "Doe");
The function doStuffworks with other functions, but makes the following returns undefined undefined:
console.log(john.doStuff(john.getFullName));
What happened to what I have, and how can I change it to make it work? Thanks.
source
share