ES6中的includes方法
在进行判断时,要包括很多选择,这时可以用到includes
比如,if(type==1||type==2||type==3)
定义一个变量进行接收,const array = [1,2,3]
if(array.includes(type)){
}
在进行判断时,要包括很多选择,这时可以用到includes
比如,if(type==1||type==2||type==3)
定义一个变量进行接收,const array = [1,2,3]
if(array.includes(type)){
}