DEV Community

Discussion on: 3 ways to remove duplicates in an Array in Javascript

Collapse
 
andrewjhart profile image
Andrew Hart • Edited

This is great for most situations, using a Map -- my personal testing has found that arrays up to a certain length still perform better with reduce, etc than Maps, but beyond N values (which I can't recall the exact amount and I'm sure it varies on the types), Map's absolutely crush them because the op is O(n), as noted by DevMan -- just thought it was worth noting.