let grade = { 'lilei' : 96, 'han' : 99 } //遍历keys console.log(Object.keys(grade)) console.log(Object.keys(grade).filter(item => item === 'lilei')) //遍历values console.log(Object.values(grade)) console.log(Object.values(grade).filter(item => item > 96)) //object.entries:把对象变成可遍历的对象 let result = [] for (let [k, v] of Object.entries(grade)) { console.log(k, v) if(k === 'lilei') { result.push(k) } } console.log(result)