DEV Community

[Comment from a deleted post]
Collapse
 
abhijitparida profile image
Abhijit Parida • Edited

The first one is the most readable (hence the best).

The second and the third methods can be combined into a more readable one liner:

[...str].reverse().join('')
Collapse
 
sswebcoder profile image
Sergey Spitsyn🐧🖥️
Array.from(str).reverse().join('')