如何在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
相關文章
相關標籤/搜索