switch (input) {
case 1:
return "this is one";
break;
default:
break;
}
can return
break the code?
Or it does what break does after return the result?
return
terminates your function, so the code won't continue executing (and potentially falling through to the next case
block). There's no point in using break
in such a situation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With