Answer the question
In order to leave comments, you need to log in
How to get all the same properties from an associative array?
There is an associative array from which you need to take all the name properties and push it into another array. But even it is not possible to do this, it turns out to take the last current. What is the best way to do this?
Here is the array itself:
var json_date = [{
"dills": {
"1": {
"name": "soker",
"time": "13:00",
},
"2": {
"name": "footbol",
"time": "15:00",
},
"3": {
"name": "bysbol",
"time": "11:00",
}
}
}]
Answer the question
In order to leave comments, you need to log in
If you are using jquery then you can
var names = $.map(json_date[0]["dills"], function(item){return item.name});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question