Category: javascript
Operators
Published on 29 Jun 2026
Explanation
Operators perform operations on variables and values. Arithmetic operators include +, -, *, /, and %.
Code:
let a = 10; let b = 5; console.log(a + b);
Explanation
Comparison operators compare values and return true or false.
Code:
console.log(10 > 5); console.log(10 === 5);
Explanation
Logical operators combine multiple conditions using &&, ||, and !.
Code:
let loggedIn = true; let isAdmin = false; console.log(loggedIn && isAdmin);
Explanation
Assignment operators update variable values efficiently.
Code:
let x = 10; x += 5; console.log(x);
Explanation
An expression combines values and operators to produce a result.
Code:
let total = 100 * 3; console.log(total);