Write a function reverseSentence(sentence) that returns the string sentence with all its characters in reverse order.
é), spaces, punctuation. Spaces at the start and the end are kept, they just move to the other end: ' a ' gives ' a ', 'ab ' gives ' ba'.'Hi 😀' gives '😀 iH'.''.Watch out: split('') cuts an emoji in half, and the result shows broken symbols. for...of and the spread syntax [...sentence] go by whole characters.
reverseSentence('I Love Java and Selenium Webdriver')Returns 'revirdbeW muineleS dna avaJ evoL I'
reverseSentence('Hi 😀')Returns '😀 iH'
Asked at Capgemini · Source
reverseSentence('I Love Java and Selenium Webdriver')'revirdbeW muineleS dna avaJ evoL I'reverseSentence('Hello')'olleH'reverseSentence('')''Hidden tests run on Submit.