var source_arr = ['a', 'b', 'a', 'c', 'a', 'd', '1',1,'1']; var array_unique = source_arr.filter(function (element, index, array) { return array.indexOf(element) === index; }); console.log(array_unique); console.log(source_arr);
数组过滤重复元素
猜你喜欢
转载自www.cnblogs.com/lishidefengchen/p/9230097.html
今日推荐
周排行