i have a javascript array like this
var myArr = [
{
"Year":"2015",
"Month":"January",
"Value":"15.8",
"District":"Anuradhapura",
"type":"Rainfall"
},
{
"Year":"2015",
"Month":"January",
"Value":"31.1",
"District":"Anuradhapura",
"type":"Temparature"
},
{
"Year":"2015",
"Month":"January",
"Value":"4",
"District":"Anuradhapura",
"type":"Wind"
},
{
"Year":"2015",
"Month":"January",
"Value":"69",
"District":"Anuradhapura",
"type":"Humidity"
}
]
what i need is to put type and Value data into 2 dimension array. my end result should be like this;
var data = [
[
"Rainfall",
158
],
[
"Temparature",
31.1
],
[
"Wind",
4
],
[
"Humidity",
69
]
]
note that myArr results i'm getting from the backend service and the length of this array can be change dynamically. how can i do this. thanks