I'm retrieving records from a .json file, that I'm generating with node.js (with fs, ejs, http, request, connect modules) ;
That's the code I'm using to retrieve the records:
<% layers.forEach(function(layer) { %>
<div class="dr-container" style="-webkit-transform: rotate(<%= layer.angle %>deg);">
<% for (j = 1; j <= layer.repeat; j++) { %>
<div class="dr-box" style="height: <%= 100 / layer.repeat %>%;background-image: url('data:image/svg+xml;charset=utf-8,<%= layer.linetype %><%= layer.swatch %>');"></div><% } %></div>
<% }); %>
(layers is the array I'm pulling info from ; angle, repeat, linetype, swatch are the fields from the input form on the template. The loop inside the div is meant to repeat the same result a certain number of times and it's working well)
What can I do to retrieve the remainder of all records divided by 6, and show only those?
Like having 38 records and showing the last 2. I understood I need a loop before the 1st line that triggers that?