JSFiddle - React, Tailwind, and code Playground

JavaScript

var list = ['Johny', 'Adam', 'Johny'];
var option = 'Johny';

var foundInList = list.some(function (el) {
    return el === option;
});

var test = false;
for (i = 0; i < list.length; i++){
    if (list[i] === option){
        test = true;
        break;
    }
}
console.log(foundInList);
console.log(test);