根据对象自身可遍历的键名或键值进行遍历,返回一个数组;根据对象自身可遍历的键值对进行遍历,返回一个数组 var info={name: "Ablaze", sex: "男", city: "西安"}Object.keys(info) //["name", "sex",
var info={name: "Ablaze", sex: "男", city: "西安"} Object.keys(info) //["name", "sex", "city"] Object.values(info) //["Ablaze", "男", "西安"] Object.entries(info)//[["name", "Ablaze"],["sex", "男"],["city", "西安"]]