Object.entries(obj)

162 阅读1分钟
var obj = {
    a:1, b:2, c:3
}
Object.entries(obj) 
// [['a', 1],['b',2],['c',3]] 
// 对象自身可枚举属性的键值对数组