javascript reverse word in a sentence code example
Example 1: reverse words in a string javascript
function reverseString(str) {
return str.split("").reverse().join("");
}
reverseString("hello");
Example 2: reverse words javascript
function reverse (word) {
word = word.split('.').reverse().join('.')
return word
}
word = 'i.like.this.program.very.much'
word = 'pqr.mno'
console.log(reverse(word))