如何在JavaScript / jQuery中查找数组是否包含特定字符串? [重复]

问题:

This question already has an answer here: 这个问题已经在这里有了答案: 数组

Can someone tell me how to detect if "specialword" appears in an array? 有人能够告诉我如何检测"specialword"出如今数组中吗? Example: 例: app

categories: [
    "specialword"
    "word1"
    "word2"
]

解决方案:

参考一: https://stackoom.com/question/PfAo/如何在JavaScript-jQuery中查找数组是否包含特定字符串-重复
参考二: https://oldbug.net/q/PfAo/How-to-find-if-an-array-contains-a-specific-string-in-JavaScript-jQuery-duplicate
相关文章
相关标签/搜索