There are a group of private methods in my class, and I need to call one dynamically based on an input value. Both the invoking code and the target...
To make a JavaScript class with a public method I’d do something like: function Restaurant() {} Restaurant.prototype.buy_food = function(){ // something here } Restaurant.prototype.use_restroom = function(){ // something here...