Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite+ 2
How to reverse a string in js
Can I know How to reverse a string in js
2 Réponses
0
You can create an array from the string, reverse the array, join all the elements by a blank space, finally convert it into a new string.
source = "Hello world";
reversed = Array.from(source).reverse().join("").toString();
console.log(reversed);
0
Thanks for answering my question