1function reverseString(s){
2 return s.split("").reverse().join("");
3}
4reverseString("Hello");//"olleH"
1function reverse(str){
2 let reversed = "";
3 for (var i = str.length - 1; i >= 0; i--){
4 reversed += str[i];
5 }
6 return reversed;
7}