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++) {
if(!hashOfArr[clients[i]]){
hashOfArr[clients[i]] = [];
}
hashOfArr[clients[i]].push(pending1[i]);
}
console.log(hashOfArr);
THis is how I have converted to JSON
var chargestot= JSON.stringify(hashOfArr);
Thanks,
Vikash