Hello friends,
Today will learn the Operators in JavaScript. Yesterday i will discuss the arithmetic operators. so, today will discuss the other operators in JavaScript.
JavaScript Operators are used to perform specific mathematical and logical computations on operands. In other words, an operator operates the operands.
example: Types of mathematical and logical computations .
The Assignment Operator (=) is used to assigns values.
The Addition Operator (+) is used to adds values.
The Multiplication Operator (*) is used to multiplies values.
The Comparison Operator (>) is used to compares values.
Types of Operators :
There are different types of Operators in JS are;
-Arithmetic Operators
-Assignment Operators
-comparison Operators
-String Operators
-Logical Operators
-Bitwise Operators
-Ternary Operators
-Typeof Operators
Arithmetic Operators : These are the operators that work on numerical values and then return a number. These are basically used to perform mathematical operations.
Assignment Operators : Assignment operators assign values to JavaScript variables.
Comparison Operator : These are the operators that are used to perform equality or difference comparisons between the values. It checks whether an element is greater, smaller equal, or unequal to the other element.
String Operators : All the comparison operators above can also be used on strings.
example: "hello" .
-Logical Operators : These are the operators which allow us to compare variables or values. The logical operator is mostly used to make decisions based on conditions specified for the statements.
-Bitwise Operators : These operators convert the number to a 32-bit binary number and perform the bitwise operation. The number is converted back to the 64-bit number after the result.
-Ternary Operators : The Ternary Operator in JavaScript is a shortcut for writing simple if-else statements. It’s also known as the Conditional Operator because it works based on a condition. The ternary operator allows you to quickly decide between two values depending on whether a condition is true or false.
-Typeof Operator : The typeof operator in JavaScript is used to determine the data type of a value or variable. It returns a string indicating the type, such as "string", "number", "boolean", "object", etc.
This is the Operators in JavaScript and i'll research from w3 schools and geeksforgeeks. Then, i will pin the link to you.
reference:
w3 schools - [https://www.w3schools.com/js/default.asp]
geeksforgeeks - [https://www.geeksforgeeks.org/javascript/javascript-operators-reference/].
Top comments (2)
Well👏, Keep going
ok, thanks.