Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reverse every word in a string javascript

function reverseWords(str) {
  const allWords = str.split(" ")
  return allWords.map(item => item.split("").reverse().join("")).join(" ")
}
 
PREVIOUS NEXT
Tagged: #reverse #word #string #javascript
ADD COMMENT
Topic
Name
2+7 =