Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
An empty statement is used to provide no statement, although the JavaScript syntax would expect one.
The empty statement is a semicolon (;) indicating that no statement will be executed, even if JavaScript syntax requires one.
The opposite behavior, where you want multiple statements, but JavaScript only allows a single one, is possible using a block statement, which combines several statements into a single one.
The empty statement is sometimes used with loop statements. See the following example with an empty loop body:
It is a good idea to comment intentional use of the empty statement, as it is not really obvious to distinguish from a normal semicolon.
In the following example, the usage is probably not intentional:
| ECMAScript® 2027 Language Specification # sec-empty-statement |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 20, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.