Does Javascript's new operator do anything but make life difficult?

前端 未结 4 1409
粉色の甜心
粉色の甜心 2020-12-28 18:21

I come from the traditional web developer background where I can by no means claim to really know anything about Javascript, however I am trying.

I currently have wh

4条回答
  •  粉色の甜心
    2020-12-28 18:47

    Here's a great article on prototype.js's implementation of the typical OO structuring. This wouldn't be possible without the "new" operator.

    http://prototypejs.org/learn/class-inheritance

    I highly recommend reading the prototype.js source. jQuery is amazing, and highly popular, but some of the things that have been done in prototype just have no comparison** elsewhere, in particular their class structuring.

    **Some people might argue that some of what prototype does shouldn't be found elsewhere - that's a different question. But for sheer understanding of what's possible with javascript, prototype is the way to go, IMHO.

提交回复
热议问题