I have an array object:
var checkin_status = [
{"startdate":"2015-01-08",
"totaldays":"3",
"roadmap":[
{"gifttype":"stars","quantity":100,"day":1},
{"gifttype":"stars","quantity":500,"day":3},
{"gifttype":"stars","quantity":1000,"day":10},
{"gifttype":"stars","quantity":1200,"day":20}
]
}];
I use $.each to display them to view, now how can I check last object in roadmap ? Because I have to give some condition for the last object. Any suggestion to do that ? Thanks