标签:javascrip asc clu log include 判断 多条件 java 简写
// 非简写
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);
}
标签:javascrip asc clu log include 判断 多条件 java 简写
原文地址:https://www.cnblogs.com/luguankun/p/14306572.html