Technology STEM
Summary of JavaScript Operators and Related Concepts
1. Types of Operators in JavaScript
Arithmetic Operators: Perform mathematical operations on numbers.
Comparison (Relational) Operators: Compare two values and return a boolean result.
Logical Operators: Combine or invert boolean values.
Bitwise Operators: Perform bitwise operations on numbers.
Assignment Operators: Assign values to variables and modify them.
Special Operators: Include conditional, comma, delete, in, instanceof, new, typeof, void, and
yield.
2. Arithmetic Operators
+ (Addition): Adds two numbers.
- (Subtraction): Subtracts one number from another.
*** (Multiplication): Multiplies two numbers.
/ (Division): Divides one number by another.
% (Modulus): Returns the remainder of a division.
++ (Increment): Increases a variable's value by one.
-- (Decrement): Decreases a variable's value by one.
** ** (Exponential): Raises a number to the power of another.
3. Comparison Operators
==: Equal to.
===: Strictly equal to (equal in value and type).
!=: Not equal to.
!==: Strictly not equal to.
>: Greater than.
>=: Greater than or equal to.
<: Less than.
<=: Less than or equal to.
4. Bitwise Operators
&: Bitwise AND.
|: Bitwise OR.
^: Bitwise XOR.
1|Page
~: Bitwise NOT.
<<: Bitwise left shift.
>>: Bitwise right shift.
>>>: Bitwise right shift with zero fill.
5. Logical Operators
&&: Logical AND.
||: Logical OR.
!: Logical NOT.
6. Assignment Operators
=: Assignment.
+=: Add and assign.
-=: Subtract and assign.
*=: Multiply and assign.
/=: Divide and assign.
%=: Modulus and assign.
7. Special Operators
?:: Conditional (ternary) operator.
,: Comma operator.
delete: Deletes a property from an object.
in: Checks if a property exists in an object.
instanceof: Checks if an object is an instance of a type.
new: Creates an instance of an object.
typeof: Returns the type of a variable.
void: Discards the return value of an expression.
yield: Pauses and resumes a generator function.
8. JavaScript Expressions
A piece of code that evaluates to a value, e.g., 2 + 1 results in 3.
9. JavaScript Keywords and Reserved Words
Keywords and reserved words have specific functions and cannot be used as identifiers.
Examples include var, let, const, if, for, function, return, etc.
2|Page
10. JavaScript Comments
Single Line Comments: Begin with // and extend to the end of the line.
Multi-line Comments: Enclosed between /* and */.
This summary provides an overview of various operators and related concepts in JavaScript,
including their syntax and examples for practical understanding.
Prepared by
Mr.J.Tolop
Techstem_knsoe_2024
3|Page