0
[
{ data: "23-04", xxx: "xxx, yyy: "yyy },
{ data: "23-04", xxx: "xxx, yyy: "yyy },
{ data: "23-04", xxx: "xxx, yyy: "yyy },
{ data: "23-05", xxx: "xxx, yyy: "yyy },
{ data: "23-05", xxx: "xxx, yyy: "yyy },
{ data: "23-05", xxx: "xxx, yyy: "yyy },
{ data: "23-06", xxx: "xxx, yyy: "yyy },
{ data: "23-06", xxx: "xxx, yyy: "yyy },
{ data: "23-06", xxx: "xxx, yyy: "yyy },
{ data: "23-06", xxx: "xxx, yyy: "yyy },
{ data: "23-06", xxx: "xxx, yyy: "yyy },
]
Hello, I need to take the above array of the total record of each date and create another array of objects containing its own name and total as new key values for example:
[{
"a": "23-04",
"b": 3
}, {
"a": "23-05",
"b": 3
},
{
"a": "23-06",
"b": 5
}
]
Can be with es6, map, reduce or even with lodash/undescore
I thank anyone who can chew this because I’m three days old and it doesn’t come out the way I need it
For you I’m sure it was only a few minutes on the keyboard to help a stranger, for me it was a relief that already suffered 3 days. Its code not only seems to work: it is perfect for my purpose and fell like a glove including solving the keys a and b with map.... My many thanks to you my dear!!!
– sidiara castro