I have a JSON file that returns this :
{
"id": 1,
"name": "",
"lastName": "",
"birthDate": "",
"invoice": [
{
"id": 1,
"date": "20/10/2015"
},
{
"id": 2,
"date": "20/8/2013"
},
{
"id": 3,
"date": "20/6/2012"
}
]
}
if I access invoice[0].date
I will get "20/10/2015"
.
I need to save in an array all three dates in this case, so that I can show it in a dropdown. <select>
option should have all three dates.
How do I save and access those in JavaScript?
var allDates=data.info[all arrays].date // date field of every object