DEV Community

loading...

Discussion on: Clean up your code with these tips!

Collapse
dechamp profile image
DeChamp Author

This is also a very nice solution. I’ll add it to the tips! Thank you. I know that for some people, regex can be a eyesore. But there is beauty in its power.

Collapse
miniscruff profile image
miniscruff

Not much difference but I like to use sets for these comparisons for faster lookups.

const localDomains = new Set([...])
localDomains.has(...)
Thread Thread
dechamp profile image
DeChamp Author

I actually also like this as a solution. Thank you!