1 for ... in
function Students(name) {
this.name = name;
this.run = function () {
console.log(this.name + ‘is running‘)
}
}
Students.prototype.score = 100
Students.prototype.learning = function () {
console.log(this.name +‘wode‘+‘hahahdf‘)
}
var newPeople = new Students(‘chenfei‘)
// newPeople.run()
Object.defineProperty(newPeople,‘name‘,{
enumerable:false,
value:‘heihei‘
})
const getOwn = Object.getOwnPropertyNames(newPeople)
console.log(getOwn)
const valueList= Object.keys(newPeople)
console.log(valueList)
for(item in newPeople){
console.log(item)
}