if ( type == 'a' || type =='b' || type == 'c' || type == 'd'){
//...
}
可使用ES6中数组实例方法includes
includes
const condition = ['a','b','c','d'];
if ( condition.includes(type) ){ //...}