Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed (UPI) Chapter 4: Mastering JavaScript Basics: Operators, Variable Scope, and Data Handling!

Instruction

Pre and Post-Increment Operators

Increment operators may be written before or after a variable. The position decides whether they are pre-increment or post-increment operators, respectively. That affects the operation.
"use strict";

// Increment occurs before a is assigned to b
let a = 1;
let b = ++a;  // a = 2, b = 2;

// Increment occurs to c after c is assigned to d
let c = 1;
let d = c++;  // c = 2, d = ...