I have an object with a set of prototype methods. How do I invoke that method given is name and arg list?
So I have and object:
scarpa.MyThing = function() {
}
MyThing
has a prototype method:
scarpa.MyThing.prototype.beAwesome = function(a, b, c) {
// do awesome stuff here with a, b, and c
}
Now, I want to call beAwesome
from another prototype method:
scarpa.MyThing.prototype.genericCaller = function(methodName, d, e, f) {
// this does not work for me
this.call(methodName, d, e, f)
}
Here is the call to genericCaller
:
this.genericCaller('beAwesome', alpha, zeta, bravo);
I am stuck on the proper syntax for the call within genericCaller
.
Can someone please enlighten me? Thanks.