我有一个字符串数组和一个字符串.我想针对数组值测试此字符串并应用条件结果 - 如果数组包含字符串do"A",否则执行"B".
我怎样才能做到这一点?
javascript arrays string testing
说我有这个
imageList = [100,200,300,400,500];
哪能给我
[0]100 [1]200 等等
[0]100 [1]200
在JavaScript中有什么方法可以返回带有值的索引吗?
即我想要200的索引,我得到返回1.
javascript arrays indexof
arrays ×2
javascript ×2
indexof ×1
string ×1
testing ×1