<p>You can order the elements with a function you supply. In the demo above, each item has a <code>data-date-created</code> and <code>data-title</code> attribute which are used for sorting.</p>
<li><code>reverse</code>: a boolean which will reverse the resulting order.</li>
<li><code>by</code>: a function with an element as the parameter. Above, we’re returning the value of the <code>data-date-created</code> or <code>data-title</code> attribute.</li>
<li><code>randomize</code>: Make the order random.</li>
<p>You can provide the entire sort compare function if you need more control.</p>
<p>The parameters (<code>a</code>, <code>b</code>) are <code>ShuffleItem</code> instances and you'll probably only use the <code>element</code> property. The <code>reverse</code> option still works with the <code>compare</code> function if you need it.</p>
<p>For example, if you wanted to sort by the first group in <code>data-groups</code>, then by <code>data-age</code>, you could do this:</p>