Object oriented javascript with prototypes vs closures

前端 未结 5 1224
醉酒成梦
醉酒成梦 2020-11-28 19:29

I\'m curious what the difference is between the following OOP javascript techniques. They seem to end up doing the same thing but is one considered better than the other?

5条回答
  •  离开以前
    2020-11-28 19:57

    here is an article about this in general Book inharets from Book.prototype. In first example you add function to getTitle Book.prototype

提交回复
热议问题