2022-11-04 js hasOwnProperty 检测对象是否含有xx属性
hasOwnProperty,一个js方法,用于检测对象中是否存在某某属性,返回一个布尔值,例:
let a = {value: 123}
console.log(a.hasOwnProperty('value')); // true
hasOwnProperty,一个js方法,用于检测对象中是否存在某某属性,返回一个布尔值,例:
let a = {value: 123}
console.log(a.hasOwnProperty('value')); // true