Hackforge Academy

Category: html_css

what is Operators

Published on 23 Jun 2026

Explanation

Operators are symbols used to perform operations on values and variables. Common arithmetic operators include +, -, *, /, and %.

Code:

let a = 10;
let b = 5;

console.log(a + b);
console.log(a - b);
console.log(a * b);
console.log(a / b);
console.log(a % b);

Explanation

Comparison operators compare two values and return a boolean result. Examples include ==, ===, !=, >, <, >=, and <=.

Code:

let age = 18;

console.log(age >= 18);
console.log(age === 18);
console.log(age != 20);

Explanation

Logical operators are used to combine multiple conditions. Common logical operators are && (AND), || (OR), and ! (NOT).

Code:

let isStudent = true;
let hasID = true;

console.log(isStudent && hasID);
console.log(isStudent || false);
console.log(!isStudent);

Explanation

Assignment operators are used to assign and update variable values. Examples include =, +=, -=, *=, and /=.

Code:

let count = 10;
count += 5;
count -= 2;
console.log(count);

Explanation

An expression is any valid combination of values, variables, and operators that produces a result.

Code:

let price = 100;
let quantity = 3;
let total = price * quantity;

console.log(total);

๐Ÿš€ Learn Spring Boot with real-world projects

๐Ÿ’ก Build REST APIs step by step

๐Ÿง  Improve backend development skills

๐ŸŽฏ Get career-ready practical training

Join Our Free WhatsApp Community

Direct access to niche-specific mentors and peers on WhatsApp.

๐Ÿ

Python Community

Discuss Django, FastAPI, AI integration, and automation scripts with 15k+ developers.

Join Python Community
โš›๏ธ

React Community

Master Next.js, Framer Motion, and State Management. Share your latest UI components.

Join React Community
โ˜•

Java Community

Deep dives into Spring Boot, Microservices architecture, and high-performance backend ops.

Join Java Community