问题:
This question already has an answer here: 这个问题已经在这里有了答案:
Can someone tell me how to detect if "specialword"
appears in an array? 有人可以告诉我如何检测"specialword"
出现在数组中吗? Example: 例:
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
来源:oschina
链接:https://my.oschina.net/u/4432649/blog/4422384