DEV Community

Cover image for The easiest way to reverse a string
Dhairya Shah
Dhairya Shah

Posted on Originally published at codewithsnowbit.hashnode.dev

The easiest way to reverse a string

In JavaScript, we have many ways to reverse a string. In this article, I will be showing the easiest way to

Let's go... 🏁

🎉

Probably, the simplest way to reverse a string is to split string to an array, reverse() it and join()

let string = "live"
string = [...string].reverse().join("")
console.log(string)
📺 Info Siaran: dhairyashah/the easiest way to reverse a string - Jadwal Siaran Langsung 📺 Info Siaran: dhairyashah/the easiest way to reverse a string - Jadwal Siaran Langsung

Thank you for reading, have a nice day!

Top comments (0)