var sel = "白";
var arr =["白色","黑色","红色","粉色"];
var arrStr = arr.join(',');
if(arrStr.indexOf(sel)!=-1){
console.log(sel)
}
var sel = "白";
var arr =["白色","黑色","红色","粉色"];
var arrStr = arr.join(',');
if(arrStr.indexOf(sel)!=-1){
console.log(sel)
}
本文标题:js判断一个数组中是否存在该条数据
本文链接:https://www.haomeiwen.com/subject/ahafwftx.html
网友评论