JavaScript-map和set

Map

        var map = new Map([['tom',100],['jack',99],['ss',89]]);
        var name = map.get('tom');
        map.delete('tom');

        var map = new Map([['tom',100],['jack',99],['ss',89]]);
        var name = map.get('tom');
        map.set('admin',123456);
        map.delete('tom');


Set:无序不重复的集合

posted on 2022-05-09 13:27  言语说  阅读(17)  评论(0编辑  收藏  举报

导航