hasOwnProperty调用
let obj = {
name: '123'}
1.
({
}).hasOwnProperty.call(obj,'name')//true
2.
Object.prototype.hasOwnProperty.call(obj,'name')//true
3.
obj.hasOwnProperty('name') //true
toString调用
let obj = {
name: '123'}
1.
console.log(({
}).toString.call(obj))//[object Object]
2.
console.log(Object.prototype.toString.call(obj))//[object Object]
3.//此方法不稳定,new String,new Number,new Date,new Array有自身的toString不适用
console.log(obj.toString())//[object Object]