write a program to reverse a string the input string is given as input h e l l o output o l l e h code example
Example: reverse every word
function reverseWords(str) {
const allWords = str.split(" ")
return allWords.map(item => item.split("").reverse().join("")).join(" ")
}