Create and modify JSON object variable by adding two diffrent array using JavaScript

Last Reply 6 months ago By kalpesh

Posted 6 months ago

Hi, I have a dynamic Hash as:

[ABC Medical Centre:[2],Atlantic Foot & Ankle Specialists:[0],BillingBridge:(6) [10, 14, 0, 0, 0, 0],Transcriptionstar:[5],theBillingBridge:[1]]

I want to store sum of each array wth corresponding name

example:var BB=BillingBridge has sum: 24 OR

var AFAS= Atlantic Foot & Ankle Specialists has sum 0

and others like the above.

I was thinking to convert the array to JSON and then store the arrays in variables.

Note: Each array is dynamic and keeps growing with more arrays and values inside the HASH.

This is how the Hash comes. I have added two different array

var hashOfArr = {};
for(i = 0; i < clients.length; i++) {
        hashOfArr[clients[i]] = [];

 THis is how I have converted to JSON

var chargestot= JSON.stringify(hashOfArr);



You are viewing reply posted by: kalpesh 6 months ago.
Posted 6 months ago

Refer the below Thread link for your reference

[Solved] Pass and Save JavaScript Array values to database using jQuery AJAX in ASP.Net

Also You can't ask multiple queries within a question. This is against forum rules and necessary to maintain clean forum.
It is requested Mark Answer the replies when question is answered and ask a new question as a responsible member to help fellow programmers around the world.
Note: If you don't mark answers, people will loose interest in your questions.

I agree, here is the link: