数组的去重

it2026-04-09  8

function dedupe(arr) { return Array.from(new Set(arr));}

var arr = [2,2,3,4,5,4];console.log(dedupe(arr)); // [2, 3, 4, 5]

 

转载于:https://www.cnblogs.com/ax-null/p/6855630.html

相关资源:vue中对象数组去重的实现
最新回复(0)