JSFiddle - React, Tailwind, and code Playground

JavaScript

const str = 'abcde'

function reverseString(str) {
  let tempString = ''
  for(let j = str.length - 1; j >= 0; j--){
   	tempString += str[j]
  }
  return tempString
}

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