I have this json file I want parse and get value of subcat
for test1
as an array in javascript. Is there an easy way to do this? I have used AngularJS $http
to get the json.
For the input:
[
{
"category":"test1",
"ID":"1",
"subcat":[
{
"completed":"4",
"uncompleted":"5"
}
]
},{
"category":"test2",
"ID":"2"
"subcat":[
{
"completed":"1",
"uncompleted":"5"
}
}
]
Expected result is [4,5]