Javascript Prototypal Inheritance?

后端 未结 5 2066
日久生厌
日久生厌 2021-02-04 05:43

I\'been doing some inheritance in js in order to understand it better, and I found something that confuses me.

I know that when you call an \'constructor function\' with

5条回答
  •  甜味超标
    2021-02-04 06:12

    Worth noting that in ECMAScript 5 (i.e. the latest version of the JavaScript language) you can get access to the internal [[Prototype]] property of an instance via Object.getPrototypeOf:

    Object.getPrototypeOf(fido) === Dog.prototype
    

提交回复
热议问题