Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
An expression evaluated after each pass through the loop. If this condition evaluates to true, statement is re-executed. When condition evaluates to false, execution continues with the statement after the do...while loop
Like other looping statements, you can use control flow statements inside statement:
Because the statement is always executed once, do...while (false) is the same as executing the statement itself. This is a common idiom in C-like languages, which allows you to use break to break out of branching logic e
Using an assignment as a condition
In some cases, it can make sense to use an assignment as a condition, such as this:
This page was last modified on Jul 8, 2025 by MDN contributors.