This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

operators

Summary

The following table lists JavaScript operators.

Syntax

Operators

DescriptionLanguage Element
Addition Assignment (+=)Adds the value of an expression to the value of a variable and assigns the result to the variable.
Addition (+)Adds the value of an expression to the value of a variable and assigns the result to the variable.
Assignment (=)Assigns a value to a variable.
Bitwise AND Assignment (&=)Performs a bitwise AND on the value of a variable and the value of an expression and assigns the result to the variable.
Bitwise AND (&)Performs a bitwise AND on two expressions.
Bitwise Left Shift (<<)Shifts the bits of an expression to the left.
Bitwise NOT (~)Performs a bitwise NOT (negation) on an expression.
[Bitwise OR Assignment (=)](/javascript/operators/bitwise_or_assignment)Performs a bitwise OR on the value of a variable and the value of an expression and assigns the result to the variable.
[Bitwise OR ()](/javascript/operators/bitwise_or)Performs a bitwise OR on two expressions.
Bitwise Right Shift (>>)Shifts the bits of an expression to the right, maintaining sign.
Bitwise XOR Assignment (^=)Performs a bitwise exclusive OR on a variable and an expression and assigns the result to the variable.
Bitwise XOR (^)Performs a bitwise exclusive OR on two expressions.
Comma (,)Causes two expressions to be executed sequentially.
ComparisonsReturns a Boolean value indicating the result of the comparison.
Compound AssignmentsList of compound assignments.
Conditional (ternary) (?:)Executes one of two expressions depending on a condition.
Decrement (–)Decrements a variable by one.
deleteDeletes a property from an object, or removes an element from an array.
Division Assignment (/=)Divides the value of a variable by the value of an expression and assigns the result to the variable.
Division (/)Divides two numbers and returns a numeric result.
inTests for the existence of a property in an object.
Equality (==)Compares two expressions to determine if they are equal.
Greater than (>)Compares two expressions to determine if one is greater than the other.
Greater than or equal to (>=)Compares two expressions to determine if one is greater than or equal to the other.
Identity (===)Compares two expressions to determine if they are equal in value and of the same data type.
Increment (++)Increments a variable by one.
Inequality (!=)Compares two expressions to determine if they are unequal.
instanceofReturns a Boolean value that indicates whether or not an object is an instance of a particular class.
Left Shift Assignment (<<=)Left shifts the value of a variable by the number of bits specified in the value of an expression and assigns the result to the variable.
Less than (<)Compares two expressions to determine if one is less than the other.
Less than or equal to (<=)Compares two expressions to determine if one is less than or equal to the other.
Logical AND (&&)Performs a logical conjunction on two expressions.
Logical NOT (!)Performs logical negation on an expression.
[Logical OR ()](/javascript/operators/logical_or)Performs a logical disjunction on two expressions.
Modulus Assignment (%=)Divides the value of a variable by the value of an expression, and assigns the remainder to the variable.
Modulus (%)Divides two numbers and returns the remainder.
Multiplication Assignment (*=)Multiplies the value of a variable by the value of an expression and assigns the result to the variable.
Multiplication (*)Multiplies two numbers.
newCreates a new object.
Nonidentity (!==)Compares two expressions to determine that they are not equal in value or of the same data type.
Right Shift Assignment (>>=)Right shifts the value of a variable by the number of bits specified in the value of an expression, maintaining the sign, and assigns the result to the variable.
Subtraction Assignment (-=)Subtracts the value of an expression from the value of a variable and assigns the result to the variable.
Subtraction (-)Performs subtraction of two expressions.
typeofReturns a string that identifies the data type of an expression.
Unary Negation (-)Indicates the negative value of a numeric expression.
Unsigned Right Shift Assignment (>>>=)Right shifts the value of a variable by the number of bits specified in the value of an expression, without maintaining sign, and assigns the result to the variable.
Unsigned Right Shift (>>>)Performs an unsigned right shift of the bits in an expression.
voidPrevents an expression from returning a value.

Attributions

  • Microsoft Developer Network: Article