JavaScript private methods

前端 未结 30 1517
-上瘾入骨i
-上瘾入骨i 2020-11-22 08:16

To make a JavaScript class with a public method I\'d do something like:

function Restaurant() {}

Restaurant.prototype.buy_food = function(){
   // something         


        
30条回答
  •  长发绾君心
    2020-11-22 09:07

    The apotheosis of the Module Pattern: The Revealing Module Pattern

    A neat little extension to a very robust pattern.

提交回复
热议问题