to true, all the forthcoming
case expression will be executed without checking the case?
consider this example:
a = 1
switch(a){
case 1:
console.log("its 1");
case 2:
console.log("its 2");
}
the above code outputs :-
its 1
its 2
Is this how switch case works in js, do we need break after each statement?
Exactly
Обсуждают сегодня