//1、Object.keys(obj) 只会遍历实例属性key值,不会遍历原型上的属性
function iterate(obj) {
const keyArr = Object.keys(obj);
const temp = [];
for(let i in keyArr){
temp[i] = keyArr[i].concat(': ',obj[keyArr[i]]);
}
return temp;
}

//1、Object.keys(obj) 只会遍历实例属性key值,不会遍历原型上的属性
function iterate(obj) {
const keyArr = Object.keys(obj);
const temp = [];
for(let i in keyArr){
temp[i] = keyArr[i].concat(': ',obj[keyArr[i]]);
}
return temp;
}