re: JavaScript Sets are Excellent! VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Cool read! Fun 'interview style' question that can utilize sets: Return an array of unique characters from the string 'Hello World', excluding spa...
 

Cool I guess you could also do
[...new Set([...'Hello World'])]

 

Almost, it won't exclude the space so you'd have to do something like [...new Set([...'Hello World'.replace(/\s/g, '')])] which kinda ruins how nice and concise this was :(

code of conduct - report abuse