const school = {
name:"中国",
cityies:["北京","上海","深圳"],
area:["朝阳区","黄埔","东城"]
}
// 获取对象所有的键
// console.log(Object.keys(school)); // (3) ["name", "cityies", "area"]
// 获取 所有的 值
// console.log(Object.values(school)); // ["中国", Array(3), Array(3)]
// entries 返回一个数组 0 键=> 1值
// console.log(Object.entries(school)); // [Array(2), Array(2), Array(2)]
// 创建 Map
// const m =new Map(Object.entries(school));
// console.log(m); // {"name" => "中国", "cityies" => Array(3), "area" => Array(3)}
// console.log(m.get(‘name‘)); // 中国
// 对象属性的 描述对象
// console.log(Object.getOwnPropertyDescriptors(school));
const obj = Object.create(null,{
name:{
value:‘Eric‘,
writable:true,
configurable:true,
enumerable: true
}
})
console.log(obj); // {name: "Eric"}