title: How to reverse a string in JavaScript using a "for...in" loop?
body: <p>I have a piece of JavaScript code using a for loop to reverse a string. However, I would like to know if it is possible to use a for in loop instead and how would I go about that?</p>
  
  <pre><code>     function reverse(str){
           var reversedString = '';
           for (var i = str.length - 1; i &gt;= 0; i--){
              reversedString = reversedString + str[i];
       }
       return reversedString;
     }
  
     alert(reverse('hello'));
  </code></pre>