Reverse string in Javascript.

There is no built-in reverse method present in String object to reverse a string.But we can reverse a string by,

  • Convert the string to arrayย , using split method.
  • Reverse the array.
  • Join the reversed array.
function reverse (string) {
      return string.split('').reverse().join();
}

That is you have finished reading small and sweet article. ๐Ÿคฉ๐Ÿ˜Ž.

Follow Javascript Jeep๐Ÿš™๐Ÿฅถย .

Leave a comment

Design a site like this with WordPress.com
Get started