the realize of js


  • 0
    J

    /**

    • @param {string} s

    • @return {string}
      */
      var reverseString = function(s) {

      var str_return = "";
      var i = 0;
      var len = s.length-1;
      for(i=len;i>-1;--i){
      str_return += s.charAt(i);
      }
      return(str_return);

    };


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.