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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:26:57+00:00 2026-06-15T07:26:57+00:00

Trying to create the following: array( ‘12345’ => ‘A01’, ‘A02’, ‘A03’ ‘22222’ => ‘B01’,

  • 0

Trying to create the following:

array( ‘12345’ => ‘A01’, ‘A02’, ‘A03’
‘22222’ => ‘B01’,
‘33333’ => ‘C01’, ‘C02’)

So basically each key is different generated dynamically from another array. Let’s say variable numbers has ‘12345’ after certain event is fired.

We have an array called location, this one will have for example (‘A01’, ‘A02’, ‘A03’)

So then on a master array it will map both numbers with the location. This is the array that i will need to save each time there is an event.

The on the next event execution we shall get a new value on numbers variable such as ‘22222’ and then a new array location will overwrite the other one with (‘B01’) for example and so on.

Remember the keys are gonna be always dynamic and the values can be from 1 to 50 for example we don’t know. I know this is more like Object Literals on Jquery. thx in advance.

Here is the piece of code, need to be able to get the key and values

             $.each(dragarray, function(index, value) {

                    dragid_loc['value'] = [];
                    // do loop to add each element of other array
                    $.each(draglocation, function(index2, value2) {
                        dragid_loc.value.push(value2);
                    });

            });

            console.log(dragid_loc);

This line seems to cause the problem i won’t push the values of another array draglocation into each. Need to get the key and the value.

dragid_loc.value.push(value2);
  • 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-15T07:26:58+00:00Added an answer on June 15, 2026 at 7:26 am

    Based in the comments I think what you need is:

    • obj["newProp"] = []; // A new property is added to the object with key newProp and an empty array as value
    • obj.newProp.push(newElement); // A new element is added to the array in newProp of object
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create an associative array that collects the following (existing on
I'm trying to create a multidimentional int array with the following function code: int
I am trying to create the following example. <body> <resources> <string-array name=mytest> <item number=1>
I am trying to create an array out of three arrays in the following
I am trying to dynamically create a Bitmap Image using byte array using following
I am trying to iterate a multidimension array created with the following line To
i'm trying to create following layout: http://jsfiddle.net/BTuMH/1/ but without setting the width, like: http://jsfiddle.net/yuGyg/
i am trying to create an .htaccess file that will achieve the following create
New with Android. Sorry! I'm trying to create the following... Wait for Timer to
I'm trying the following: CREATE TABLE Table1 ( RecordNo autonumber, --error here! PersonId varchar(50),

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.