# Operators

Revision Information
• Revision slug: JavaScript/Reference/Operators
• Revision title: Operators
• Revision id: 68618
• Created:
• Creator: QuesoLoco
• Is reviewed? Yes
• Reviewed:
• Reviewed by: Jay
• Is approved? Yes
• Is current revision? No
• Comment Typo Fix; 1 words added, 1 words removed

## Revision Content

Arithmetic Operators

(`+`, `-`, `*`, `/`, `%`, `++`, `--`, unary `-`)

Arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value.

Assignment Operators

(`=`, `+=`, `-=`, `*=`, `/=`, `>>=`, `<<=`, `>>>=`, `&=`, `|=`, `^=`)

An assignment operator assigns a value to its left operand based on the value of its right operand.

Bitwise Operators

(`&`, `|`, `^`, `~`, `<<`, `>>`, `>>>`)

Bitwise operators treat their operands as a set of 32 bits (zeros and ones) and return standard JavaScript numerical values.

Comparison Operators

(`==`, `!=`, `===`, `!==`, `>`, `>=`, `<`, `<=`)

A comparison operator compares its operands and returns a logical value based on whether the comparison is true.

Logical Operators

(`&&`, `||`, `!`)

Logical operators are typically used with boolean (logical) values, and when they are, they return a boolean value.

String Operators

(`+` and `+=`)

The string operators concatenate two string values together, returning another string that is the union of the two strings.

Member Operators

(`object.property` and `object{{ mediawiki.external('\"property\"') }}`)

Member operators provide access to a property or method of an object.

Special Operators
There are several special operators that do not fit into any other category:
Conditional Operator

(`condition ? ifTrue : ifFalse`)

The conditional operator returns one of two values based on the logical value of the condition.

Comma Operator

(`,`)

The comma operator allows multiple expressions to be evaluated in a single statement and returns the result of the last expression.

delete Operator

(`delete`)

The delete operator deletes objects.

function Operator

(`function`)

The function operator defines a function.

get Operator

(`get`)

The get operator defines a property to be a getter.

in Operator

(`in`)

The in operator determines whether an object has a given property.

instanceof Operator

(`instanceof`)

The instanceof operator determines whether an object is an instance of another object.

let Operator

(`let`)

The let operator temporarily assigns a value to a variable that only affects an expression.

new Operator

(`new`)

The new operator creates an instance of a constructor.

set Operator

(`set`)

The set operator defines a property to be a setter.

this Operator

(`this`)

The this operator refers to the execution context.

typeof Operator

(`typeof`)

The typeof operator determines the type of a given object.

void Operator

(`void`)

The void operator discards an expressions return value.

yield Operator

(`yield`)

The yield operator determines what is returned in a generator by that generator's iterator.

Operator Precedence
Operator precedence defines the order in which operators are evaluated.

{{ languages( { "es": "es/Referencia_de_JavaScript_1.5/Operadores", "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Op\u00e9rateurs", "ja": "ja/Core_JavaScript_1.5_Reference/Operators", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Operatory" } ) }}