Is Break necessary in switch case JavaScript?

The break Keyword It is not necessary to break the last case in a switch block . The block breaks (ends) there anyway. Note: If you omit the break statement, the next case will be executed even if the evaluation does not match the case.

Sizin İçin Seçtik  Can we use or condition in switch case in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *