Fe-interview: [js] 第232天 举例说明constructor和instanceof的区别是什么?

Created on 3 Dec 2019  ·  1Comment  ·  Source: haizlin/fe-interview

第232天 举例说明constructor和instanceof的区别是什么?

我也要出题

js

Most helpful comment

  • constructorobject 的属性之一,instanceof 是运算符
  • constructor 的结果是方法,instanceof 的结果是布尔值
  • constructor 获取的是原型链的最顶层,instanceof 可以判断是否属于原型链的任意一层

>All comments

  • constructorobject 的属性之一,instanceof 是运算符
  • constructor 的结果是方法,instanceof 的结果是布尔值
  • constructor 获取的是原型链的最顶层,instanceof 可以判断是否属于原型链的任意一层
Was this page helpful?
0 / 5 - 0 ratings