Js constructor function

Isn"t the

h object constructed by the Hero constructor function? How instanceof built-in constructor Object function is also true?

Mar.14,2021

because of prototype inheritance.

h is constructed by the Hero constructor, while Hero inherits from Object , so h instanceof Object is true . And Hero instanceof Object is also true .

clipboard.png

The

instanceof operator is used to determine whether a prototype chain of objects to be detected is an object pointed to by the prototype property of the constructor
all constructor functions are derived from Function.prototype
js everything is an object, and all objects are from Object.prototype


js all objects are from Object.prototype, so all instances are instances of Object

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e44f2c-44ae9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e44f2c-44ae9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?