js遍历对象的方法记录 let a ={ 2018:'1', 2019:'2', 2020:'4', 2021:'5', } console.log(Object.keys(a)); //["2018", "2019", "2020", "2021"] console.log(Object.values(a)); //["1", "2", "4", "5"]