title: How can i loop through a list of items and push their data values into an array?
body: <p>Trying to loop through a list of items that all have data-ids added, I basically want to push each of these values into an array but not sure how this can be achieved or where I need to place the loop index, the code I've got so far is:</p>
  
  <p>JS</p>
  
  <pre><code>// Find all boxes and length
  var box = _.els.grid.children(),
            box_l = box.length,
            i = 0;
            box_arr = [];
  
  //create array of all box datas
  for ( i; i &lt;= box_l; i++ ) {
    box_arr.push( box.data('id')[i] );
  }
  console.log( box_arr );
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;ul id="grid" class="clearfix"&gt;
      &lt;li class="a" data-id="1"&gt;&lt;/li&gt;
      &lt;li class="b" data-id="2"&gt;&lt;/li&gt;
      &lt;li class="c" data-id="3"&gt;&lt;/li&gt;
      &lt;li class="d" data-id="4"&gt;&lt;/li&gt;
      &lt;li class="e" data-id="5"&gt;&lt;/li&gt;
      &lt;li class="f" data-id="6"&gt;&lt;/li&gt;
      &lt;li class="g" data-id="7"&gt;&lt;/li&gt;
      &lt;li class="h" data-id="8"&gt;&lt;/li&gt;
      &lt;li class="i" data-id="9"&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>