Javascript Operators
What is Operators?
Operators are used to perform operation on single or multiple value (operand) and produce a result. Following are Operators that are available in javascript
Assignment operator
Assignment operator assign value to javascript variables. Following are assignment operators available in javascript
Arithmetic operator
Arithmetic operator are used to perform arthmetic calculation on numbers(literals or variables). Following are arithmetic operators available in javascript
Unary operator
Unary operator are used to perform operation on single operand. Following are unary operators available in javascript
Logical operator
Logical operator are used to perform operation on multi operand. Following are logical operators available in javascript
Comparison operator
Comparison operators are used in logical statements to determine equality or difference between variables or values. Following are Comparison operators available in javascript
Bitwise operator
Bitwise operator are used to perform operation on multi operand. Following are logical operators available in javascript
typeof operator
The typeof operator returns a string indicating the type of the unevaluated operand.
Usage: typeof operand
Ternary (conditional) operator
Ternary operator shortcut for if else statement. The conditional (ternary) operator is the only JavaScript operator that takes three operands: a condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:), and finally the expression to execute if the condition is falsy.
Usage: condition ? ifTrueStatement : ifFalseStatement