title: javascript array/object.push not working
body: <p>input:</p>
  
  <pre><code>var variants = [];
  $("div.product[data-variant]").each(function() {
      variants = [{name:chocolate, url:http://urltochocolate.de;
  });
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>$.each(optionList, function (i, el) {
    combo.append('&lt;option value="'+ el.url +'"&gt;' + el.name + "&lt;/option&gt;");
  });
  </code></pre>
  
  <p>the above version works, but if i want to save all variants not only the last by adding a variants.push it won't work. i know push is an array function but how does it work for JS objects? or does a push work but then i use the wrong output function?</p>
  
  <p>any help appreciated, it can't be so difficult, just not seeing the solution :(</p>
  
  <p>EDIT:</p>
  
  <p>it was not the missing Quotes, as chocolate and the url are only placeholders for jQuery Selectors</p>