答案 0 :(得分:2)
您可以Object.keys与Array.prototype.includes链接以实现
Object.keys(myObject).includes(myKey);
const myObject = { name: 'Peter' };
const myKey = 'name';
const result = Object.keys(myObject).includes(myKey);
console.log(`Includes key ${myKey}? `, result);

答案 1 :(得分:2)
您可以使用some()
和hasOwnProperty()
var array = [{3892: 'value'}, {1234: 'value'}];
var check = array.some(obj => obj.hasOwnProperty(3892));
console.log(check)