// 非简写
let x = 'a'
if (x === 'a' || x === 'b' || x === 'c' || x === 'd') {
console.log(11111);
}
// 简写
let arr = ['a', 'b', 'c', 'd']
if (arr.includes(x)) {
console.log(11111);
}
// 如果是判断是不是空值,那就不用像上面那样了
let y = null
if (y==null || y ==undefined || y==''){
console.log(2222);
}
// 要写成这样啊
if(!y){
console.log(2222);
}
// 封装成方法
let includesContent = (arr,x) =>arr.includes(x)
console.log(includesContent(arr,NaN)); // true
console.log(includesContent(arr,null));// true
console.log(includesContent(arr,undefined));// true
console.log(includesContent(arr,'a'));// true
console.log(includesContent(arr,66)); // false