var destCity = function(paths) { let destCity = paths[0][1]; while(true){ const findCity = paths.find((path) => path[0] === destCity); if(!findCity) return destCity; destCity = findCity[1]; } };