JSFiddle - React, Tailwind, and code Playground

by Salmin Skenderovic

JavaScript

const reverse = (str) => {
  const result = []
  for (let i = str.length-1; i > -1; i--) {
    result.push(str[i])
  }
  return result.join('');
}

console.log(reverse("hejsan"))