JS-018

Beginner3 min~3 min read#assignment#operator#variables
Assignment Operator =
Put a value inside
Goal
Learn how the assignment operator stores a value inside a variable.
Explanation
- The = operator is used to store a value in a variable.
- JavaScript first evaluates the expression on the right side.
- Then the resulting value is stored in the variable on the left.
- The = sign does not mean mathematical equality. It means "store this value".
- This is one of the most important operators in JavaScript.
Analogy
The = sign is like a conveyor belt that places a ready item into a labeled box.
Code
let fruit = "Apple";
console.log(fruit);Result: Apple
Common mistake
Many beginners think = means "equals". In JavaScript it is the assignment operator, not an equality check.
Remember
- ✦ = stores a value in a variable.
- ✦ The right side is evaluated first.
- ✦ Then the value goes into the variable.
Quick Quiz
What does the = operator do?