title: Reverse a string in javascript without using any inbuilt function
body: <pre><code> function reverse1(str){
    var a = "";
    for(var i = 0; i &lt;= str.length/2; i++){
      a = str[i];
      str[i] = str[str.length-i-1];
      str[str.length-i-1] = a;
    }
    return str;
  }
  var str = "abcdef";
  reverse1(str);
  </code></pre>
  
  <p>I want to reverse a string without using any inbuilt function, and I want it to change the original string itself but it doesn't work well.
  The language is Javascript.</p>