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 8497713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:12:17+00:00 2026-06-11T00:12:17+00:00

Just want to loop an array in javascript. This is my base array var

  • 0

Just want to loop an array in javascript.

This is my base array

var family = ["1A+1C","1A+2C","1A+3C","2A","2A+1C","2A+2C","2A+3C"];

and i want the ageset0 to ageset6 array values in to be fetched as per the slot. currenlty the ageset0 values are getting printed all the way

how to achieve it. thanks in advance.

this is the sample page.

http://jsfiddle.net/baVU2/2/

  • 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-11T00:12:18+00:00Added an answer on June 11, 2026 at 12:12 am

    If I understood your question then I think you want something like this (you want both arrays ageset0 and ageset1 to be printed, currently there is only ‘ageset0’ is being printed through the loop)

    for(i=0; i<family.length; i++)
    {
        var max=Math.max(ageset0.length, ageset1.length);
        for(k=0; k<max; k++)
        {              
            var a=age[k] ? age[k] : '', a0=ageset0[k] ? ageset0[k] : '',
            a1=ageset1[k] ? ageset1[k] : '', f=family[k] ? family[k] : '';
            document.write("STARCOMP , "+a+ " , "+a0+" ,"+a1+", "+f+"<br>");
            document.write("<br>");
        }
    }
    

    DEMO.

    Update: (From the comment)

    var allArrays=[ageset0, ageset1, ageset2, ageset3, ageset4, ageset5,ageset6];
    var a=age, f=family;
    for(x=0; x<allArrays.length; x++)
    {
        var ag=allArrays[x];
       for(k=0; k<ag.length; k++)
       {              
           document.write("STARCOMP , "+a[k]+ " , "+ag[k]+", "+f[k]+"<br>");
           document.write("<br>");
       }
    }
    

    DEMO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in a situation where I just want to append values in string array
I just want to ask if anybody has done something like this. Basically, it's
I have an array to loop in smarty. My array look like this: Array(
I'm sure this is an easy one. I just want to dump the set
Okay, I've created an array in c# and want to access the values in
I know this is a quite easy problem but I just want to solve
Just want to ask if i can use Custom Validator in client side without
Just want to make sure one thing. In a windows machine (either a desktop
Just want to know if publishing an application on Google play is allowed using
Just want to know how to read an attribute of a parent node from

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.