Given the following:
var example = [{
"logged": {
"status": 0,
"status_name": "Logged",
"hours": 23 // to the hours array
},
"pending": {
"status": 3,
"status_name": "Pending",
"contribution": {
"hours": 0,
"count": 0
},
"verification": {
"hours": 6, // to the hours array
"count": 1
}
},
"denied": {
"status": 4,
"status_name": "Denied",
"contribution": {
"hours": 0,
"count": 0
},
"verification": {
"hours": 0, // to the hours array
"count": 0
}
},
"approved": {
"status": 2,
"status_name": "Approved",
"contribution": {
"hours": 4.5,
"count": 1
},
"verification": {
"hours": 0, // to the hours array
"count": 0
}
}
}];
How would I construct two (2) arrays like such:
var statusNames = ["Logged", "Pending", "Denied", "Approved"];
var hours = [23, 6, 0, 0];
I can infer how to get the rest if the values from the solution.
Array#map... What efforts did you put ?