Guest User

Untitled

a guest
Jul 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. function reverseString(str) {
  2. //initialize a new variable
  3. var x = "";
  4.  
  5. //Use a for loop to loop through the string
  6. for (var i = str.length; i >= 0; i--) {
  7.  
  8. x += str[i];
  9. ;
  10. }
  11.  
  12. return x;
  13.  
  14. }
Add Comment
Please, Sign In to add comment