I have json data like
{
"itinerary": {
"carrier": "9W",
"refundable": false,
"dept": {
"flightList": [
{
"from": {
"date": "200713",
"code": "KTM",
"terminal": null,
"time": "1430"
}
},
{
"from": {
"date": "210713",
"code": "BOM",
"terminal": "1B",
"time": "0440"
}
},
{
"from": {
"date": "210713",
"code": "AMD",
"terminal": null,
"time": "1420"
}
}
]
}
}
} Now i want to display 'KTM' and 'AMD' from json which is first and last array of itinerary.dept.flightList Now I could get first index like this {itinerary.dept.flightList[0].from.code} but i couldn't get last one. Could anyone help me to get last index of itinerary.dept.flightList without using loop