Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
When break; is encountered, the program breaks out of the innermost switch or looping statement and continues executing the next statement after that.
The following function has a break statement that terminates the while loop when i is 3, and then returns the value 3 * x.
The following code has a break statement that terminates the switch statement when a case is matched and the corresponding code has run.
This page was last modified on Jul 8, 2025 by MDN contributors.