title: Unable to get foreach working with canvas
body: <p>My setup is NodeJS connected to MongoDB using EJS.</p>
  
  <p>I have a bench/lab mapping app I'm making and I was using the Lodash foreach function to populate the benches based on database objects. Currently I have this working to dynamically build an SVG image of the map, I want to start using the canvas element instead, but can't get it to work.</p>
  
  <p>Here's the working SVG version:</p>
  
  <pre><code>&lt;svg version="1.1"
   xmlns="http://www.w3.org/2000/svg" 
   xmlns:xlink="http://www.w3.org/1999/xlink" 
   x="0px" 
   y="0px"
   viewBox="0 0 520 1820" 
   enable-background="new 0 0 520 1820" 
   xml:space="preserve"&gt;
   &lt;g id="Background"&gt;
  &lt;rect fill="#D1D3D4" stroke="#000000" stroke-miterlimit="10" width="520" height="1820"/&gt;
  &lt;/g&gt;
      &lt;!--Run forEach for each bench entry in DB--&gt;
      &lt;% _.each(labs, function(lab) { %&gt;
  
      &lt;!--Set bFill variable to null--&gt;
          &lt;% bFill = null; %&gt;
  
      &lt;!--Check if the bench is set to active. If true, it sets bFill to green, if not it sets to grey--&gt;
          &lt;% if (lab.active == true) { this.bFill='#008000'; this.LabActive+1; }else{ this.bFill='#C0C0C0' ; } %&gt;
  
                  &lt;!--Fill in RECT info from DB fields--&gt;
                  &lt;g id="&lt;%= lab.number %&gt;"&gt;
                      &lt;title&gt;- Lab bench Info - 
                      Bench: &lt;%= lab.number %&gt;
                      User: &lt;%= lab.currentUser %&gt;
                      &lt;/title&gt;
                      &lt;rect 
                            class="bench" 
                            id="&lt;%= lab.number%&gt;" 
                            x="&lt;%= lab.x %&gt;" 
                            y="&lt;%= lab.y %&gt;" 
                            fill="&lt;%= this.bFill %&gt;" 
                            stroke="#000000" 
                            stroke-width="0.25" 
                            stroke-miterlimit="10" 
                            width="&lt;%= lab.w %&gt;" 
                            height="&lt;%= lab.h %&gt;"  
                            /&gt;
                  &lt;/g&gt;        
                  &lt;% }) %&gt;
  
  &lt;/svg&gt;
  </code></pre>
  
  <p>Here is the not working Canvas version:</p>
  
  <pre><code>&lt;!--Begin Canvas--&gt;
  &lt;canvas id="labCanvas" width="520" height="1820" style="border:5px solid #000000"&gt;&lt;/canvas&gt;
      &lt;script&gt;
          var c = document.getElementById("labCanvas");
          var ctx = c.getContext("2d");
  
          //      Run forEach for each bench entry in DB
      _.each(labs, function(lab) {
  
          //      Fill in RECT info from DB fields            
  
      ctx.rect(lab.x, lab.y, lab.w, lab.h);
      ctx.stroke();
  
  
                  })
  &lt;/script&gt;
  </code></pre>
  
  <p>Am I missing something or doing something wrong?</p>