switch可以判断表达式,如下:
var cond = 111;//天气状况
switch(true) {
case cond==100:
console.log(1);
break;
case cond>100:
console.log(2);
break;
}