var sentence = "Welcome to this Javascript Guide!";
var splitted = sentence.trim().split(/\s+/)
var reversed = splitted.map((word)=>{
return word.split("").reverse().join("")
})
var reversedSentence = reversed.join(" ")
console.log(reversedSentence)
output:
emocleW ot siht tpircsavaJ !ediuG
No comments:
Post a Comment