一. 对象扩展方法 Object.fromEntries
// 二维数组 转为对象
const result = Object.fromEntries([
['name','王蓉'],['study','skill']
])
console.log(result); //{name:'wangrong',study:'skill'}
//Map
const m = new Map();
m.set('name','wangrong')
console.log(m); //{'name' => 'wangrong'}
const result1 = Object.fromEntries(m);
console.log(result1); //{name:'wangrong'}
// Object.entries Es8
const arr = Object.entries({
name: 'wangronbg'
})
console.log(arr); //[Array(2)] [['name','wangrong']]