[removed] What are .extend and .prototype used for?

前端 未结 7 1021
渐次进展
渐次进展 2020-12-02 04:40

I am relatively new to JavaScript and keep seeing .extend and .prototype in third party libraries I am using. I thought it had to do with the Prototype javascript library, b

7条回答
  •  借酒劲吻你
    2020-12-02 05:26

    • .extends() create a class which is a child of another class.
      behind the scenes Child.prototype.__proto__ sets its value to Parent.prototype
      so methods are inherited.
    • .prototype inherit features from one to another.
    • .__proto__ is a getter/setter for Prototype.

提交回复
热议问题