| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Statements/Empty | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.
empty JavaScript .
const array1 = [1, 2, 3];
// Assign all array values to 0
for (let i = 0; i < array1.length; array1[i++] = 0 /* empty statement */);
console.log(array1);
// Expected output: Array [0, 0, 0]
;
empty statement JavaScript (;). JavaScript block statement .
. .
var arr = [1, 2, 3];
// Assign all array values to 0
for (i = 0; i < arr.length; arr[i++] = 0 /* empty statement */);
console.log(arr);
// [0, 0, 0]
: , empty statement . . killTheUniverse() if .
if (condition); // Caution, this "if" does nothing!
killTheUniverse() // So this always gets executed!!!
: ({}) if...else three true four else case launchRocket() .
if (one) doOne();
else if (two) doTwo();
else if (three); // nothing here
else if (four)
doFour();
else launchRocket();
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-empty-statement |
This page was last modified on 2025 2 11 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |