I have a nesting function that produces multiple arrays as it runs through its looping. So I end up with a few lines of arrays, but want to make them a bit easier to read as they're to be used for a cutting list.
An example of an array might be: 280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280 - Offcut: 60 343,343,343,343,343,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280 - Offcut: 25
So I'm trying to write within the same function without calling another, that can count how many individual quantities of each length will fit within a given limit.
The way I'm printing these results is by changing the innerHTML of a cell.
document.getElementById("descOutput").innerHTML += "<br/><b>Result:</b>"+arr;
document.getElementById("descOutput").innerHTML += " - <b>Offcut:</b> "+off;
That way, after each loop that produces an answer that is under the limit, it writes it into the cell.
What I'm hoping to achieve is as below:
[280 x23] - Offcut: 60
[343 x5,280x17] - Offcut: 25
Can anybody help?