function Person(name, age) { this.name = 'Tom'; this.age = 11;};Person.prototype = { job:'资深前端开发工程师',};var p = new Person();console.log(p.name);console.log(p.age);console.log(p.job);console.log('name是对象p自身的属性吗?',Object.prototype.hasOwnProperty.call(p, 'name'));//trueconsole.log('age是对象p自身的属性吗?',Object.prototype.hasOwnProperty.call(p, 'age'));//trueconsole.log('job是对象p自身的属性吗?',Object.prototype.hasOwnProperty.call(p, 'job'));//false 复制代码