I am creating a little Shape class in javascript for canvas to kill some time. I was wondering if I could do something like below,
var Shape = function (shape) {
// pseudo code
if (shape is a prototype function of Shape) {
shape();
}
}
Shape.prototype.quad = function () {
}
So for the above the only valid string would be quad
as that is the only prototypal function defined.
Is this possible?