JS-Object 详解

71 阅读1分钟

1、打印Object,属性列表如下

image.png

属性名解释
constructor构造函数
hasOwnProperty判断属性是否是自身非继承
isPrototypeOfA.isPrototypeOf(B)判断A是不是B的原型
propertyIsEnumerable判断属性是否可枚举
toLocaleString将对象转化为字符串参照所在地区格式
toString返回字符串表示
valueOf返回对象本身
protonull

2、重点关注 constructor属性

image.png