1function reverseString(s){
2 return s.split("").reverse().join("");
3}
4reverseString("Hello");//"olleH"
1function reverseString(str) {
2
3 var newString = "";
4
5 for (var i = str.length - 1; i >= 0; i--) {
6 newString += str[i];
7
8 return newString;
9}
10
11reverseString('hello');
1function reverseString(str) {
2 var newString = "";
3 for (var i = str.length - 1; i >= 0; i--) {
4 newString += str[i];
5 }
6 return newString;
7}
8reverseString('hello');
1str.split('').reduce((reversed, character) =>{
2 return character + reversed;
3 }, '');
4//apple = leppa