title: fabricjs objects order in group
body: <p>I have no idea how to order objects in group other then repeat add and remove to sort the objects.</p>
  
  <p>I tried <code>unshift</code> on group objects but it does not save state.</p>
  
  <pre><code>$(document).on("click", "#addToGroup", function() { 
  var objects = canvas.getActiveObject();
  
      if(objects &amp;&amp; objects.type === "activeSelection") {
        objects.toGroup();
        canvas.requestRenderAll();
      }   
  });
  
  
  count = 1;   
  
  $(document).on("click", "#addObject", function() {
      canvas.add(new fabric.Rect({
        width: 100, height: 100, left: 100 + (count * 20), top: 20 + (count * 10), angle: -10,
        fill: 'rgba(0,200,0,1)'
      }));
  });
  </code></pre>
  
  <p><a href="https://jsfiddle.net/9vpqL7w0/1/" rel="nofollow noreferrer">Template JSFiddle</a></p>