Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8837037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:37:38+00:00 2026-06-14T09:37:38+00:00

I have a javascript calculator coded not by me and I’m doing front-end coding,

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:37:39+00:00Added an answer on June 14, 2026 at 9:37 am

    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:

            for (var RowNumber = 1; RowNumber < 13; RowNumber ++)
            {
                Graph += "<tr>";
                for (var colIndex = 0; colIndex < Calc.Graphic.length / 12; colIndex ++){
                    var rowIndex = RowNumber + 12*colIndex
                    Row = Calc.Graphic[rowIndex];
                    Graph += "<td>"+ rowIndex +"</td>";
                    Graph += "<td>" + Row.SummPay + "</td>";
                }
                Graph += "</tr>";
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have JavaScript that is doing activity periodically. When the user is not looking
I am making a small calculator (just for JavaScript learning) and I have two
Until this morning I did not know it was possible to have JavaScript in
Writing a small HTML web page with some very simple Javascript in it, I
Im doing some javascript code and im using firefox. i have a problem which
I have following JavaScript function to make some calculation with textboxes but when I
I have a JavaScript function for a HTML button click event in aspx page
I am doing a calculator for savings and I have the following multi-condition in
I have a javascript function which needs to do a numerical calculation. Some of
Possible Duplicate: JavaScript post request like a form submit I have a value calculated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.