JAVASCRIPT Tutorial
Purpose: Assign values to variables.
let name = "John Doe";
+=
: Add a value-=
: Subtract a value*=
: Multiply by a value/=
: Divide by a value%=
: Modulo (remainder)let count = 5;
count += 2; // Equivalent to count = count + 2;
let
keyword creates a variable.// Create a variable called "age" and assign it the value 25.
let age = 25;
What are they?
Assignment operators are used to assign values to variables.
let name = "John Doe";
+=
: Add a value-=
: Subtract a value
Example: let count = 5; count += 2; // Equivalent to count = count + 2;
Key Tip:
// Assign the value 25 to the variable "age".
let age = 25;