TGViewer
Web Development - HTML, CSS & JavaScript Web Development - HTML, CSS & JavaScript @javascript_courses · 55.7K subscribers
Post #3694 1.25K
💻 JavaScript Roadmap 2026 — Part 3

🟢 JavaScript Operators & Expressions

Operators are symbols or keywords that tell JavaScript to perform an operation.

For example:

let a = 10;

let b = 5;

console.log(a + b);

Here, "+" is an operator.

1️⃣ Arithmetic Operators

Arithmetic operators are used for mathematical calculations.

Addition "+"

let a = 10;

let b = 5;

console.log(a + b);

Output:

15

Subtraction "-"

console.log(a - b);

Output:

5

Multiplication *

console.log(a * b);

Output:

50

Division "/"

console.log(a / b);

Output:

2

Remainder "%"

Returns the remainder after division.

console.log(10 % 3);

Output:

1

This is particularly useful for checking whether a number is even or odd.

let number = 10;

console.log(number % 2 === 0);

Output:

true

Exponentiation **

Used for powers.

console.log(2 ** 3);

Output:

8

2️⃣ Assignment Operators

Assignment operators assign values to variables.

Basic assignment

let score = 100;

"=" means "assign this value."

It does not mean mathematical equality.

Addition assignment

let score = 100;

score += 20;

console.log(score);

Output:

120

This is equivalent to:

score = score + 20;

Similarly:

score -= 10;

score *= 2;

score /= 5;

score %= 3;

These are called compound assignment operators.

3️⃣ Increment and Decrement

Increment "++"

let count = 5;

count++;

console.log(count);

Output:

6

Decrement "--"

let count = 5;

count--;

console.log(count);

Output:

4

You'll frequently see these inside loops.

4️⃣ Comparison Operators

Comparison operators compare values and return either:

true

or

false

Greater than ">"

console.log(10 > 5);

Output:

true

Less than "<"

console.log(10 < 5);

Output:

false

Greater than or equal ">="

console.log(10 >= 10);

Output:

true

Less than or equal "<="

console.log(5 <= 10);

Output:

true

5️⃣ Equality Operators

Loose equality "=="

console.log(5 == "5");

Output:

true

JavaScript performs type conversion before comparing.

Strict equality "==="

console.log(5 === "5");

Output:

false

The values look similar, but their types are different:

5 → number

"5" → string

Strict inequality "!=="

console.log(5 !== "5");

Output:

true

Best practice

For normal JavaScript development, prefer:

===

!==

over:

==

!=

because strict comparison avoids unexpected type conversion.

6️⃣ Logical Operators

Logical operators are extremely important when creating conditions.

AND "&&"

Returns true when both conditions are true.

let age = 25;

let hasID = true;

console.log(age >= 18 && hasID);

Output:

true

Both conditions must be true.

Example:

Age ≥ 18 → true

Has ID → true

Result → true

If either condition is false, the overall result is false.

OR "||"

Returns true when at least one condition is true.

let hasEmail = false;

let hasPhone = true;

console.log(hasEmail || hasPhone);

Output:

true

Because one condition is true.

NOT "!"

Reverses a Boolean value.

console.log(!true);

Output:

false

And:

console.log(!false);

Output:

true

Example:

let isLoggedIn = false;

if (!isLoggedIn) {

console.log("Please log in");

}
  • ❤ 3
More from @javascript_courses
  1. Oct 4, 2026DSA Handwritten Notes
  2. Sep 28, 2026To learn web design and development from basic to advanced levels, you can follow these st…
  3. Sep 27, 202610 Websites Every Developer & AI Enthusiast Should Bookmark ✅ roadmap.sh – Step-by-step le…
  4. Sep 26, 2026🔹 Escape Characters 2️⃣5️⃣ New Line You can use \n and \t: const message1 = "Hello\nWorld…
  5. Sep 26, 2026const fileName = "report.pdf"; console.log(fileName.endsWith(".pdf")); // true 🔹 Finding…
  6. Sep 26, 2026💻 JavaScript Roadmap 2026 — Part 8 🟢 Strings & String Methods Strings are used to repres…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →