var x = 3;
switch (x) {
case 1:
document.write(x);
break;
case 2:
document.write(x + 2);
default:
document.write(x + 5);
}
//结果为: