Since there is no 'built in' way to remove duplicates (ECMA-262ECMA-262 actually has Array.forEach
which would be great for this), we have to do it manually. Note that this pollutes the Array
prototype, use with caution.
Add 2023 answer using `Array.some` and predicate function variable
dota2pro
- 7.7k
- 8
- 49
- 87
Christophe Roussy
- 16.7k
- 4
- 91
- 85