return str.split("").reverse().join("");
const str = 'JavaScript is awesome';
function reverseAString(str) {
return str.split('').reverse().join('');
}
console.log(`Reversed string is: ${reverseAString(str)}`);
const reverse = str => str.split('').reverse().join('');
reverse('hello world');
// Result: 'dlrow olleh'
function reverseString(s){
return s.split("").reverse().join("");
}
reverseString("Hello");//"olleH"
function reverseString(str) {
let strList = str.split('');
let reversed = strList.reverse();
return reversed.join('');
}
var s = userInput[0];
var rev = [];
for(let i=0;i<s.length;i++)
{
rev.push(s[s.length-1-i]);
}
console.log(rev.join(""));
const reverse = str => [...str].reverse().join``;