0

Could you explain it?

var sub = 'Eng'; switch (sub) { case 'Eng': document.write(1); case 'Es': document.write(2); } // output '12'

29th Mar 2020, 2:20 PM
Nikolay Romeiko
Nikolay Romeiko - avatar
2 ответов
+ 4
Because there is no break statement between the cases.
29th Mar 2020, 2:22 PM
Gordon
Gordon - avatar
0
Thanks
29th Mar 2020, 2:24 PM
Nikolay Romeiko
Nikolay Romeiko - avatar