let obj = {name: '123'} 1. ({}).hasOwnProperty.call(obj,'name')//true 2. Object.prototype.hasOwnProperty.call(obj,'name')//true 3. obj.hasOwnProperty('name') //true
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]