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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:47:38+00:00 2026-05-14T01:47:38+00:00

I have a generated nested Array which I store some data. How can i

  • 0

I have a generated nested Array which I store some data.

How can i get the 3rd nested array (in this case the array starting with “yellow”)

the array looks like this (this is a dynamically generated array):

[
    ["Large", 
       ["yellow", "green", "Blue"],
       ["$55.00", "$55.00", "$55.00"]
     ]
    ["Medium",
       ["yellow", "green", "Blue", "Red"],
       ["$55.00", "$55.00", "$55.00", "$55.00"]
    ]
    ["small",
       ["yellow", "green", "Blue", "Red"],
       ["$55.00", "$55.00", "$55.00", "$55.00"]
    ]
]

I am trying to get to the [“yellow”, “green”, “Blue”] array’s length and loop to get the values

for(i=0; colorNSize.dataArray[0][0][1].length<i; i++){
    alert(colorNSize.dataArray[colorNSize.Sizeindex][0][0][i])// alert's A (which is the char[1] of the second array.
}

alert(colorNSize.dataArray[0][0][1].length) actually alerts the length of “Large” which is “5”
is there a limit for nested arrays?
Can i still get the real 3rd array nested here?

  • 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-05-14T01:47:39+00:00Added an answer on May 14, 2026 at 1:47 am

    Your formatting is probably wrong – does “Large” reside in the same array as the array of colors and then prices? Indentation tells it is, brackets say it’s all nested. Have you forgotten a bracket after the array of prices?

    Anyway, [0][0][1] already refers to chars of “Large”. [0][0] is “Large”, [0][1] is the other array.

    Consider this simplified example:

    >>> arr = [['large', [[1, 2], [3, 4]]]]
    [["large", [[1, 2], [3, 4]]]]
    >>> arr[0]
    ["large", [[1, 2], [3, 4]]]
    >>> arr[0][0]
    "large"
    >>> arr[0][1]
    [[1, 2], [3, 4]]
    >>> arr[0][1][0]
    [1, 2]
    

    Can you see what’s going on?

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

Sidebar

Related Questions

I have generated an excel file from xml. But i can not open it
I have generated a collection of images. Some of them are blank as in
I have generated using openssl mycert.pem which contents the certificate. And I converted the
I have a nested form in which I would like the form fields to
I know this is a vague open ended question. I'm hoping to get some
I have a page with deeply-nested HTML elements generated from a framework. I would
For a SOAP service I have to generate an object, which can have an
I'm new to jQuery, familiar with PHP & CSS. I have nested, dynamically generated
This is a JavaScript/Ajax webpage (also using jQuery). I have a nested structure I
I have a Forum model, whose instances can have many nested forums: class Forum

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.