I'm trying to do something simple but it doesn't work.
I have two arrays that have a structure like this;
total ->
[0]-> [Day: 2016-04-19, Total: 23]
[1]-> [Day: 2016-04-18, Total: 20]
failed ->
[0]-> [Day: 2016-04-19, Failed: 2]
[1]-> [Day: 2016-04-18, Failed: 0]
I'm trying to add the "Failed" key with it's value to the "total" array but it just won't bite so the output looks something like this;
arr ->
[0]-> [Day: 2016-04-19, Total: 23, Failed: 2]
[1]-> [Day: 2016-04-18, Total: 23, Failed: 0]
...
The "total" I have assigned to var sql1 and "failed" I have assigned to var sql2 and then I've tried various functions and for loops like:
for (var i = 0; i < sql1.length; i++) {
sql1[i][2] = sql2[i][1];
}
Yet sql1 remains the same. What am I doing wrong?
I've also tried
sql1[i].push(sql2[i][1]);
But that didn't work either.