To make a JavaScript class with a public method I\'d do something like:
function Restaurant() {} Restaurant.prototype.buy_food = function(){ // something
The apotheosis of the Module Pattern: The Revealing Module Pattern
A neat little extension to a very robust pattern.