title: FOR LOOP with nested IF statement
body: <p>I have some code which loops through an array and adds the data to a HTML table.</p>
  
  <p>For one of the fields 'Unit_Sell', I would like to prefix the HTML with a '£' symbol.</p>
  
  <p>Here is what I have tried.</p>
  
  <pre><code> for (var i = 0; i &lt; arr.length; i++) {
     var node = win.document.createElement("tr")
  
     for (var key of ['description', 'ref_date_start', 'ref_date_end', 'unit_sell', 'qty', 'price']) {
       var tb = win.document.createElement("td")
  
       if (key = 'unit_sell') {
         tb.innerHTML = '£' + arr[i][key]
       }
  
       tb.innerHTML = arr[i][key]
       tb.style.paddingLeft = "30px";
       node.appendChild(tb)
     }
   }
  </code></pre>
  
  <p>The loop works fine, but the if statement condition is not being met.</p>