美文网首页
ES8-对象方法扩展entries

ES8-对象方法扩展entries

作者: 冰点雨 | 来源:发表于2022-08-10 09:22 被阅读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);
    

    相关文章

      网友评论

          本文标题:ES8-对象方法扩展entries

          本文链接:https://www.haomeiwen.com/subject/mwfrwrtx.html