有,可以使用Object.prototype.hasOwnProperty.call()方法來替代hasOwnProperty方法。例如:
var obj = {
key: 'value'
};
if (Object.prototype.hasOwnProperty.call(obj, 'key')) {
console.log('The key exists in the object.');
} else {
console.log('The key does not exist in the object.');
}