// .find method only accepts a callback function
// and returns the first value for which the function is true.
const cities = [
"Orlando",
"Dubai",
"Denver",
"Edinburgh",
"Chennai",
"Accra",
"Denver",
"Eskisehir",
];
const findCity = (element) => {
return element === "Denver";
};
console.log(cities.find(findCity));
//Expected output is 4 (first instance of "Denver" in array)