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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:42:18+00:00 2026-05-17T20:42:18+00:00

I always had this silly doubt in mind but never had come up with

  • 0

I always had this silly doubt in mind but never had come up with the solution.

I have seen several kind of arrays but I don’t know the difference between them. I don’t know how to explain exactly but it’s most when passing parameters with jQuery.

See:

{ 'choices[]': ["Jon", "Susan"] } in $("#objectID").load("test.php", { 'choices[]': ["Jon", "Susan"] } );

What’s the {}? (does this mean it’s an array?). Why is choices[] quoted? I have already seen unquoted ones, what’s the difference? I presume that choices is the associative name and ["Jon", "Susan"] is the value, is it right?

  • 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-17T20:42:19+00:00Added an answer on May 17, 2026 at 8:42 pm

    The braces { } will construct an object using the object literal notation. You are not constructing an array, but an object, even though JavaScript objects can also be thought of as associative arrays.

    Further reading:

    • Douglas Crockford: A Survey of the JavaScript Programming Language (scroll to the Objects section)

    Apart from the few primitive types (numbers, strings, booleans, null and undefined) everything is an object in JavaScript (even functions).

    Objects are basically containers of properties, which happen to be very useful for collecting and organizing data.

    The object literal notation (the braces { } method that you describe) is very handy for creating objects:

    var myFirstObject = {
       'name': 'Bobby',
       'surname': 'Smith'
    };
    

    The quotes around property names are optional if the name would be a legal JavaScript identifier and not a reserved word. That is why 'choices[]' is quoted in your example, because it is not a legal JavaScript identifier. A property’s name can be any string as long as it is quoted.

    Objects can also contain other objects, so they can easily represent trees or graphs:

    var myFlight = {
       'airline': 'Airline Name',
       'number': 'AN700',
       'departure': {
          'IATA': 'SYD',
          'time': '2010-09-04 23:10:00'
       },
       'arrival': {
          'IATA': 'LAX',
          'time': '2010-09-05 05:14:00'
       }      
    };
    

    JavaScript objects also happen to be a convenient hash table data structure, and can be used as associative arrays as mentioned earlier. You could easily do the following:

    var myHashTable = {};
    myHashTable['name'] = 'Bobby';
    myHashTable['surname'] = 'Smith';
    
    // subscript notation:
    alert(myHashTable['name'] + ' ' + myHashTable['surname']);
    
    // dot notation: (equivalent)
    alert(myHashTable.name + ' ' + myHashTable.surname);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is something I have always had confusion about I never can seem to
I always had this question: When i dont mind the exact floating number Which
I've had this problem for a while now but I have to remedy it
Okay, so I've read some other people have had this problem, but they either
I've had this problem in the past, and the solution was always a configuration
Looks like others have had this problem but I can't seem to find a
We have always had languages that were preferable to be used in a particular
I have modified a working Windows service that had always been starting beforehand. After
This might sound a bit dumb. I always had this impression that web.config should
I've had this come up a couple times in my career, and none of

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.