Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Increment and Decrement | Basic Operations
course content

Contenido del Curso

Introduction to JavaScript

Increment and DecrementIncrement and Decrement

Increment and Decrement are operations used to increase or decrease a variable's value by 1.

Increment

The increment operation is performed using the ++ operator:

Note

The expression a++ is equivalent to a = a + 1 or a += 1.

Decrement

The decrement operation is performed using the -- operator:

Note

The expression a-- is equivalent to a = a - 1 or a -= 1.

Increment and decrement operations are frequently used in loops, which we will discuss in more detail later.

Choose the correct result:

Selecciona la respuesta correcta

¿Todo estuvo claro?

Sección 3. Capítulo 4
course content

Contenido del Curso

Introduction to JavaScript

Increment and DecrementIncrement and Decrement

Increment and Decrement are operations used to increase or decrease a variable's value by 1.

Increment

The increment operation is performed using the ++ operator:

Note

The expression a++ is equivalent to a = a + 1 or a += 1.

Decrement

The decrement operation is performed using the -- operator:

Note

The expression a-- is equivalent to a = a - 1 or a -= 1.

Increment and decrement operations are frequently used in loops, which we will discuss in more detail later.

Choose the correct result:

Selecciona la respuesta correcta

¿Todo estuvo claro?

Sección 3. Capítulo 4
some-alt