title: reverse string using recursion javascript
body: <p>In this program I've tried to check whether the given input is string or not, if not string means console out the input value, else reverse the string using the recursion function.. When I provide the <code>typeof</code> in code, I got an error in first line, without it it runs correctly...</p>
  <pre><code>function reverseString(str) {
    if (typeof str !== &quot;string&quot;){
      return str;
    }
    else{
     return reverseString(str.substr(1)) + str.charAt(0);
   }
  }
  console.log(reverseString(&quot;good&quot;));
  </code></pre>