DEV Community

Discussion on: Reverse a String in JavaScript

Collapse
 
atnbueno profile image
Antonio Bueno • Edited

The regex can be simpler (a period is already a single character, and case sensitivity does not affect it):

let regex = /./g
Enter fullscreen mode Exit fullscreen mode
Collapse
 
swarnaliroy94 profile image
Swarnali Roy

Thank you for the suggestion. This is a better one