Hi,
I have a question about some sample code shown on page 55 of this book
var coolcat = function (spec) {
var that = cat(spec),
super_get_name = that.superior('get_name');
// Can I replace the line above with the line below?
// super_get_name = that.get_name();
that.get_name = function (n) {
return 'like ' + super_get_name() + ' baby';
// And the line above with the line below?
// return 'like ' + super_get_name + ' baby';
};
return that;
};
Can anybody tell me whether the replacement suggested in the comments would achieve the same result? If so, then the 'superior' method proposed in this section of the book seems pointless.
Thanks, Don