es6一行代碼搞定數組去重

運用知識點: …擴展運算符(擴展運算符用三個點號表示,功能是把數組或類數組對象展開成一系列用逗號隔開的值)以及Set key不能重複的特性web var shuzu =["red","blue","red","green","blue"]; var quchonghou = [...new Set(shuzu)]; console.log(quchonghou,Array.isArray(quc
相關文章
相關標籤/搜索