// lastIndexOf only requires a single value
// and returns the index of last instance of value found in array
const cities = [
"Orlando",
"Denver",
"Edinburgh",
"Chennai",
"Denver",
"Eskisehir",
"Yokohama",
"Denver",
"Chennai",
];
console.log(cities.lastIndexOf("Denver"));
// Expected output is 7
//The lastIndexOf() method returns the index of the last occurrence of a specified text in a string:
let str = "Please locate where 'locate' occurs!";
str.lastIndexOf("locate");
// >> 21
//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
// lastIndexOf only requires a single value
// and returns the index of last instance of value found in array
const cities = [
"Orlando",
"Denver",
"Edinburgh",
"Chennai",
"Denver",
"Eskisehir",
"Yokohama",
"Denver",
"Chennai",
];
console.log(cities.lastIndexOf("Denver"));
// Expected output is 7
//The lastIndexOf() method returns the index of the last occurrence of a specified text in a string:
let str = "Please locate where 'locate' occurs!";
str.lastIndexOf("locate");
// >> 21
//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)