星際農場
文章分類關於我

刪除Array中重複的值

2019年4月2日

最簡單的方法:

const uniq = [...new Set(array)];

本文參考這一篇文章
https://stackoverflow.com/questions/9229645/remove-duplicate-values-from-js-array

© 2026 星際農場. All rights reserved.