ES6數組去重

使用ES6的新語法對數組去重,相比ES5省去了排序再作雙重For循環javascript (function() { 'use strict'; let arr = [1, '1', 2, '2', 3, '3', 3, '3', 2, '2', 1, '1']; let new_set = new Set(arr); let new_arr = Array.from(
相關文章
相關標籤/搜索