DEV Community

Cover image for #7DaysJS: Reverse a String

#7DaysJS: Reverse a String

Lautaro Lobo on December 02, 2019

Welcome to day 4 of 7 Days of JavaScript! Today we will see how to reverse a string. It’s probably the most asked question ever on technical inter...
Collapse
 
bharath_bheemireddy profile image
Bharath_Bheemireddy

const reverseString = str => str.split('').reverse().join('');
Collapse
 
lautarolobo profile image
Lautaro Lobo

That's I think the best way to do it!