Hi all,
Is it possible to execute function this way:
this.values(value);
not
this.values[value]();
this.values[value].call();
If so, how? Or any other methods? Thank you.
Here is my code:
write: function(value) {
this.values = {
"red": function() { /* do something */ },
"orange": function() { /* do something */ },
"blue": function() { /* do something */ }
};
return this.values[value]();
}
write("red");