DEV Community

loading...

Discussion on: Reverse a String - Four JavaScript Solutions

Collapse
quantumsheep profile image
Nathanael Demacon

.split('') can be shortened:

[...string].reverse().join('')
Collapse
rhysbrettbowen profile image
Rhys Brett-Bowen

Also good because split will fail badly for some utf8 things like emojis