如何在JavaScript中检查字符串数组是否包含一个字符串?
如何在JavaScript中检查字符串数组是否包含一个字符串?
This question already has answers here:
我有一个字符串数组和一个字符串。我想将该字符串与数组值进行比较,并根据结果应用条件 - 如果数组包含该字符串,则执行“A”,否则执行“B”。
我该如何实现?
admin 更改状态以发布 2023年5月24日
This question already has answers here:
我有一个字符串数组和一个字符串。我想将该字符串与数组值进行比较,并根据结果应用条件 - 如果数组包含该字符串,则执行“A”,否则执行“B”。
我该如何实现?