字符串转换为数组
let str = "antzone";
console.log([...str]);
数组去重
let arr = [3, 5, 2, 2, 5, 5];
let unique = [...new Set(arr)];
console.log(unique);
删除字符串中重复的元素
let str = "antzone";
let arr = [...str];
var set = new Set(arr);
console.log(Array.from(set).join(""));
数组合并
var a = [1, 2, 3];
var b = ["a", "b", "c"];
console.log([...a,...b]);
实现获取数组中最大值
console.log(Math.max(...[14, 3, 77]));
判断一个值是否是NaN本身
var num = NaN;
console.log(Number.isNaN(num));