Created
July 30, 2020 15:34
-
-
Save katepapineni/f2616d3a6b1634fdd1641531042ebe82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const flights = [ | |
{ route: 'Frankfurt to Hong Kong', hours: 11.5 }, | |
{ route: 'San Fransisco to Delhi', hours: 15.75 }, | |
{ route: 'Singapore to Paris', hours: 13.5 }, | |
{ route: 'Delhi to Dubai', hours: 4 }, | |
]; | |
const findFlights = (city) => { | |
return (flight) => { | |
return flight.route.includes(city); | |
} | |
} | |
// What's the output? | |
console.log(flights.find(findFlights('Delhi')).route); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment