1. 判断是否为数组的方法
1. Array.isArray(arr) === true
2. Object.prototype.toString.call(arr) === '[object Array]'
3. arr instanceof Array === true
2. 一行代码数组去重
1. const newArr = [...new Set(arr)]
2. const newArr = arr.filter((item, index) => arr.indexOf(item) === index)