DEV Community

Discussion on: Remove duplicates from an Array the short & sweet way!

Collapse
 
garetmckinley profile image
Garet McKinley

Maybe it's just my own ignorance not being familiar with the Set syntax. But the Array.filter method is so widely used that I'd know instantly what that line did. The example in the original post would confuse me to no end if there were no comments. I'd definitely have to google to figure out what's going on and why.

I'm sure the syntax is nice when you're familiar with it, but it's just not something that's done very often, so I'd definitely always leave a comment before it if you're using it in a code base that other people will have to read eventually.

Thread Thread
 
ajmalhassan profile image
Ajmal Hassan

I agree, Set isn't something we commonly use.