x=2; switch (x) { case 1: x += 5; alert(x); break; case 2: x += 10; alert(x); //12 break; case 3: x += 15; alert(x); break; default: x += 20; alert(x); break; }
The
x=2; switch (x) { case 1: x += 5; alert(x); case 2: x += 10; alert(x); //12 case 3: x += 15; alert(x); //27 default: x += 20; alert(x); //47 }