JSFiddle - React, Tailwind, and code Playground
JavaScript
var Str2 = function(strs, str){
return strs.filter(function(el){
return el == str;
}).length > 1;
}
var teste1 = Str2(["a", "b", "a", "c"], "c"); //=> "false"
var teste2 = Str2(["a", "b", "a", "c"], "a"); //=> "true"
console.log(teste1, teste2);