SOURCE

function compareStr(arrays, str) {
    for (var ay of arrays) {
        if (ay == str) {
            return true;
        }
    }
    return false;
}


var arrays = ["abc", "ef", "hg"];
console.info(compareStr(arrays, "abc"));
console 命令行工具 X clear

                    
>
console