Determine whether an object has a certain property/a certain value hasOwnProperty
hasOwnProperty
It is the only method in js that can judge that an attribute is defined in the object itself instead of inheriting the prototype chain. It is mainly used to judge whether there is a certain attribute in an object, and the return value is a Boolean value
var someObj = {
id: '' }
someObj.hasOwnProperty('id') // true
someObj.hasOwnProperty('name ') // false
simple record