JSFiddle - React, Tailwind, and code Playground

by Dmitri Ganenco

JavaScript

var fruits = ["Banana is yellow", "Orange juice", "Apple is red", "Mango is orange"];
var index;
fruits.forEach((el, i) => {
	if(el.toLowerCase().indexOf('Mango'.toLowerCase()) !== -1) {
		index = i;
	}
});
console.log(index);