Flight Logic
JavaScript
var parent =
[
{arr : 'MAA', dep : 'DEL'},
{arr : 'CCU', dep : 'IXB'},
{arr : 'COK', dep : 'DUB'},
]
var child = [
{
from : '', current : '', to : ''
}
]
// (special)If it is first iteration, then initiate empty obj, with current, to as arr
// (normal)Create two object 1. fill from, current as arr, to as arr, 2. fill from as dep
// (if last array) do not do 2.