数组去重(数组元素为普通类型)

4年以前  |  阅读数:242 次  |  编程语言:JavaScript 
console.log(Array.from(new Set([1, 2, 3, 3, 4, 4]))) //[1,2,3,4]
console.log([...new Set([1, 2, 3, 3, 4, 4])]) //[1,2,3,4]

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8