在node.js中使用Set

var set = new Set();
set.add(1);
console.log("test1 : " + set.has(1) + " ; " + set.has(2));
set.add(2);
console.log("test2 : " + set.keys() + " , " + set.values() + " , " + set.entries());
set.delete(1);
console.log("test3 : " + set.has(1) + " ; " + set.has(2));

参考链接:https://blog.csdn.net/zdhsoft/article/details/54343212

posted @ 2018-05-23 08:52  zifeiy  阅读(672)  评论(0编辑  收藏  举报