An empty statement in JavaScript is a statement that does nothing. It is represented by a semicolon (;
) on its own. Although it does not perform any action, it can be used in loops, conditionals, or in places where a statement is syntactically required.
Example:
for (let i = 0; i < 5; i++) { ; }
// No operation happens in the loop, but the loop is still valid
Tags: basic, JavaScript, statements
URL: https://www.tiktok.com/@jsmentoring/photo/7462028520613547296