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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:47:33+00:00 2026-05-31T10:47:33+00:00

I am learning JS from scratch and implementing HighCharts code using JS. Seeing one

  • 0

I am learning JS from scratch and implementing HighCharts code using JS. Seeing one of the demo I see a variable data array declaration like below:

        data = [{
        y: 55.11,
        color: colors[0],
        drilldown: {
           name: 'MSIE versions',
           categories: ['MSIE 8.0', 'MSIE 6.0', 'MSIE 7.0', 'MSIE 9.0'],
           data: [{
               y: 33.06,
               drilldown: {
                   name: 'drilldown next level',
                   categories: ['a', 'b', 'c'],
                   data: [23,54,47],
                   color: colors[0]
               }
           }, 10.85, 7.35, 2.41],
           color: colors[0]
        }
     }, {
         y: 21.63,
        color: colors[1],
        drilldown: {
           name: 'Firefox versions',
           categories: ['Firefox 3.6', 'Firefox 4.0', 'Firefox 3.5', 'Firefox 3.0', 'Firefox 2.0'],
           data: [13.52, 5.43, 1.58, 0.83, 0.20],
           color: colors[1]
        }
     }];

What does this ‘data’ array declaration means?

  • 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-31T10:47:35+00:00Added an answer on May 31, 2026 at 10:47 am

    It is an array with two elements, each one an object. Those are declared in object literal notation. For instance, the second element is this:

    {
        y: 21.63,
        color: colors[1],
        drilldown: {
           name: 'Firefox versions',
           categories: ['Firefox 3.6', 'Firefox 4.0', 'Firefox 3.5', 'Firefox 3.0', 'Firefox 2.0'],
           data: [13.52, 5.43, 1.58, 0.83, 0.20],
           color: colors[1]
        }
     }
    

    This object is composed of various properties. For instance, the property “y” has the value 21.63. The property “drilldown” is another object and so on. Primitives, arrays, and objects can be embedded ad infinitum.

    Furthermore, I can deduct that data[ 0 ] and data[ 1 ] appear to be similar objects since they have the same properties.

    One thing that may help if you’re having a hard time seeing the structure is being very strict about your code style, especially indentation. I’ve reworked it a little bit and shown a very generous spacing. It takes up more lines, but it should be clearer what is related.

    data = [
        {
            y: 55.11,
            color: colors[0],
            drilldown: {
            name: 'MSIE versions',
                categories: ['MSIE 8.0', 'MSIE 6.0', 'MSIE 7.0', 'MSIE 9.0'],
                data: [
                    {
                        y: 33.06,
                        drilldown: {
                            name: 'drilldown next level',
                            categories: ['a', 'b', 'c'],
                            data: [23,54,47],
                            color: colors[0]
                        }
                    },
                    10.85,
                    7.35,
                    2.41
                ],
                color: colors[0]
            }
        },{
            y: 21.63,
            color: colors[1],
            drilldown: {
                name: 'Firefox versions',
                categories: ['Firefox 3.6', 'Firefox 4.0', 'Firefox 3.5', 'Firefox 3.0', 'Firefox 2.0'],
                data: [13.52, 5.43, 1.58, 0.83, 0.20],
                color: colors[1]
            }
        }
    ];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a newbie and learning core data from scratch. I've got the coredatamodel
Currently, I am using Javascript - The Definitive Guide for learning Javascript from scratch.
I'm learning C++ from scratch, and as such I don't have an expert understanding
I got the Wrox.Beginning.JavaScript.3rd.Edition and wanted to start learning it from scratch, then my
I'm developing an MVC framework in PHP from scratch; mostly for the learning experience
in the book i'm learning from i came across this code snippit: while (i
I have never designed a database/data-model/schema from scratch, especially for a web-application. In some
I am learning Java from scratch. I installed the JDK, and I got the
I think I'm gonna start learning Python web development from scratch. So if someone
Currently i am working on developing one Warehouse solution from scratch, i am planning

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.