fork download
  1. // your code goes here
  2. function reverseString(str){
  3. strRev = "";
  4.  
  5. for(let i=0; i<str.length; i++){
  6. strRev = str[i] + strRev;
  7. }
  8. return strRev;
  9. }
  10.  
  11. console.log(reverseString("Hello"));
  12.  
Success #stdin #stdout 0.04s 17092KB
stdin
Standard input is empty
stdout
olleH