Object的hasOwnProperty()方法返回一个布尔值,判断对象是否包含特定的自身(非继承)属性。 if(client.hasOwnProperty(‘id’){ pear.id=client.id }