new Set()与...new Set()是有区别的,...表示的是超引用,他会将对象放入一个数组中,所以以下两种输出结果有所区别
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
var arr3 = [1,2,3,2,1];
console.log([new Set(arr3)]);
console.log([...new Set(arr3)]);
</script>
</body>
</html>