思路:set内容唯一,将数组去重形成set对象,再对set对象结构并push到新数组中返回 Array.prototype.uniq=function(){ var arr=this var newobj=new Set(arr) var newarr=[] newarr.push(...newobj) return newarr } var s=[false, true, undefined, null, NaN, 0, 1, {}, {}, 'a', 'a', NaN] var res= ...