_.uniq(arrayOfOptions) vs [...new Set(arrayOfOptions)]Fastest: _.uniq(arrayOfOptions) (2.2x faster)
21,448,266 ops/sec
9,585,930 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| _.uniq(arrayOfOptions) | |
| [...new Set(arrayOfOptions)] |
| Test name | Executions per second |
|---|---|
| ✓ _.uniq(arrayOfOptions) | 21,004,104 Ops/sec |
| [...new Set(arrayOfOptions)] | 9,295,818 Ops/sec |