1、set的增删改查
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程</title>
</head>
<body>
</body>
<script>
let s = new Set([])
//添加
s.add('a')
s.add('b')
s.add('c')
s.add('d')
s.add('e')
console.log(s) // 1 2
//删除
s.delete('c');
console.log(s)
//循环遍历
for(var i of s){
if(i=="b"){
i="bb";//更新
}
console.log("集合里面的元素是:"+i);
}
</script>
</html>