JSFiddle - React, Tailwind, and code Playground

JavaScript

const str = 'abcde'

function reverseString(str) {
 return str.split('').reverse().join('')
}

console.log('str:', str)
console.log('reverse:', reverseString(str))