title: Random rectangles as array
body: <p>When I run this code as  html,  the rectangles won't come up properly </p>
  
  <p>Any idea to get a proper outcome? </p>
  
  <p>Thank you for your help </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;link href="css/styles.css" rel="stylesheet"&gt;
    &lt;/head&gt;
    &lt;body&gt;
  
      &lt;h1&gt;My Website&lt;/h1&gt;
  
      &lt;p&gt;This is my first website&lt;/p&gt;
  &lt;script&gt;
  var w=(Math.floor(Math.random()*10))+2;
  document.write("width:"+(w+1));
  var h=(Math.floor(Math.random()*10))+3;
  document.write("height:"+h);
  var cua = new Array;
  cua[0]="|";
  cua[w]="|";
  
  for (i=1;i&lt;w;i++){
      cua[i]=" ";
  }
  //base y techo
  var bas = new Array;
  
  for (k=0;k&lt;(w+1);k++){
      bas[k]="-";
  }
  
  document.write(bas.join(""));//techo
  
  for (j=1;j&lt;(h+1);j++){
      document.write(cua.join(""));
  }
  //join quita las comas
  document.write(bas.join(""));//base
  
    &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;     </code></pre>
  </div>
  </div>
  </p>