DEV Community

Discussion on: Basic Javascript: Removing Duplicates from an Array

Collapse
 
clarity89 profile image
Alex K.

While you do have a point there, I think array.splice(0, array.length, ...(new Set(array))) would be more confusing for beginners ;)

Thread Thread
 
lesha profile image
lesha 🟨⬛️

that's a nightmare tbh

Thread Thread
 
tails128 profile image
Tails128

I would say that is something which should not be taught to new devs, cause it will push them in the wrong direction, to be fair.