In this tutorial we will use the following methods:
- split(): this method will split the string into an array of characters.
- reverse(): this method reverses all the elements of an array.
- join(): This method joins all the elements of the array to create a string.
let s = 'StackHowTo'; let rev = s.split('').reverse().join(''); console.log(rev);
oTwoHkcatSMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More