First of all, I want to say I really tried searching for this because I feel as if this has been asked before. Perhaps I'm using the wrong terminology, but I haven't found anything yet. Anyways the question is:
Suppose I have a parent class:
function Parent(){
this.say = function(words){
console.log(words);
};
}
And a child class that inherits from this:
function Child(){
Parent.call(this);
}
I want the child class to have the say function except I want to predefine the arguments. For example, the non-ideal way to do this would be to just rewrite the function by adding:
this.say = function(){
console.log("hello")
}
But I would much rather somehow call the parent's say function and specify the argument "hello"
How would do you do this? OR - is this the wrong way to think about javascript inheritance and if so, what would you recommend?