title: How to duplicate a string 10 times
body: <p>I have a prompt that asks the user to enter one word and then I want to duplicate this word 10 times using a for loop and show the result in an alert box.</p>
  
  <p>It's just I can't seem to figure out what I need to enter inside my for loop to get it to duplicate my message variable ten times and then save the result to another variable which I can show in my alert box. Does someone know how to do this in Javascript?</p>
  
  <p>Edit: This is the code I tried now:</p>
  
  <pre><code>function button() {
      var message = prompt ("Enter a word", "");
      for(var i = 0; i &lt; 5; i++) {
          message += message;
      }
      alert (message);
  }
  </code></pre>