title: Javascript loop to return string x times
body: <p>I'm doing Udacity javascript studies now and there is one quiz that bothers me. I know how to do it easily in ruby, but this one is killing me.</p>
  
  <p>I need to call function and return "ha" num times and add "!" at the end with the loop.</p>
  
  <p>I tried this but it didn't help. Should be very simple.</p>
  
  <pre><code>function laugh(num) {
    for (var x = 0; num; x ++) {
        return 'ha';
    }
  }
  
  console.log(laugh(3));
  </code></pre>