What is a Statement?

So far, we've seen some components that make up the vocabulary for a programming language, such as variables, operators, and keywords. JavaScript uses this vocabulary to form "statements" or instructions that run in a web browser. This article describes several of the types and groups of keywords used in JavaScript statements. We'll drive into JavaScript keywords in the next section.

If you have programmed in another language, you will notice that statements in JavaScript use a similar syntax to Java, C++, or Python. Most statements contain one or several lines of code that perform a task. For example, a "declaration-statement" creates a variable, a "conditional-statement" handles a decision, and a "looping-statement" executes code many times. JavaScript statements written on one line do not require a semicolon (";"), but it is best practice to end each line with one. 

Iterations

do...while

Creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once.

for

Creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop.

for...in

Iterates over the enumerable properties of an object, in arbitrary order. For each distinct property, statements can be executed.

for...of

Iterates over iterable objects (including arrays, array-like objects, iterators and generators), invoking a custom iteration hook with statements to be executed for the value of each distinct property.

for await...of

Iterates over async iterable objects, array-like objects, iterators and generators, invoking a custom iteration hook with statements to be executed for the value of each distinct property.

while

Creates a loop that executes a specified statement as long as the test condition evaluates to true. The condition is evaluated before executing the statement.