关于if中判断条件
if(
type == 1 ||
type == 2 ||
type == 3 ||
type == 4 ||
){
//...
}
=============================
const condition = [1,2,3,4];
if( condition.includes(type) ){
//...
}
关于if中判断条件
if(
type == 1 ||
type == 2 ||
type == 3 ||
type == 4 ||
){
//...
}
=============================
const condition = [1,2,3,4];
if( condition.includes(type) ){
//...
}