📌  相关文章
📜  如果数组包含字符串 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:01.827000             🧑  作者: Mango

代码示例3
function droids(arr) {
    result = "These are not the droids you're looking for." 
    
    for (str of arr) {
        if (str == 'Droids')
            result = "Found Droids!"
    }
    
    return result;
}