I have a javascript calculator coded not by me and I’m doing front-end coding, to make it usable on web page with UI. There’s a piece of code when all calculations are done and it starts to prepare data for UI.
for (var RowIndex in Calc.Graphic)
{
Row = Calc.Graphic[RowIndex];
Graph += "<tr>";
Graph += "<td>"+ RowIndex +"</td>";
Graph += "<td>" + Row.SummPay + "</td>";
Graph += "</tr>";
}
This loop males table with payment schedule, and I need to exlude from it first and last iteration because it technical data. RowIndex – is month count and Row.SummPay is Summ.
Here’s the table after javascript work. How can I exclude 0 and 13.
Month SummPay
0 0
1 84501
2 70418
3 58682
4 48901
5 40751
6 33960
7 28300
8 23583
9 19653
10 16378
11 13648
12 11225
13 1000
And if there’s more then 12 month stop loop and start forming new table floated left like
1 84501 13 11225
2 70418 14 11225
3 58682 15 11225
4 48901 16 11225
5 40751 17 11225
6 33960 18 11225
7 28300 19 11225
8 23583 20 11225
9 19653 21 11225
10 16378 22 11225
11 13648 23 11225
12 11225 24 11225
Simple. Don’t use for … in.
Instead, use this for the first thing.
From what I understand, it should be a product of 12. In which case: