ES8-对象方法扩展entries

2022-08-10  本文已影响0人  冰点雨
// entries
        let school = {
            name:'北大',
            citys:['北京','上海'],
            subject:['web','js','大数据']
        }
        // console.log(Object.keys(school));//[ "name", "citys", "subject" ]
        // console.log(Object.values(school));//[ "北大", (2) […], (3) […] ]
        // console.log(Object.entries(school));//返回键值对数组
        // let m = new Map(Object.entries(school));
        // console.log(m);
上一篇下一篇

猜你喜欢

热点阅读