title: Javascript: getting rid of nested loop
body: <p>It's been a while since I wrote any Javascript. Is there a more elegant way to do this. Specifically want to get rid of the second loop: </p>
  
  <pre><code>&lt;script&gt;
  
  var number = 0;
  for (var i=1; i&lt;11; i++) {
      for (var x=1; x&lt;11; x++) { 
  
          if (i==1) { 
              number = x;
          } else { 
              number = Math.pow(i, x);
          }
  
          document.write(number + " ");
  
          if (x == 10) { 
              document.write("&lt;br&gt;");
          }
      }
  }
  
  &lt;/script&gt;
  </code></pre>