JavaScript Keywords Index

Below is a listing of all JavaScript Keywords language. Click on an item to visit its documentation.

//

Use to add a single line comment, or comment out a single line of code.

/* */

Use to add a multi-line comment, or comment out multiple lines of code.

+

Adds two values together or concatenates two strings into a single string.

-

Subtracts the value of a number from another number.

*

Multiples the values of two numbers.

/

Divides a number by another number.

%

Divides a number by another number and returns the remainder.

++

Increments the value of a number by 1.

--

Decrements the value of a number by 1.

- (unary)

Changes the sign of a signed integer.

=

Assigns a value to a variable or other object.

+=

Adds the value of the first item to the second item and assigns the total to the first item as a new value.

-=

Subtracts the value of the second item from the first item and assigns the total to the first item as a new value.

*=

Multiples the value of the first item by the second item and assigns the total to the first item as a new value.

/=

Divides the value of the first item by the second item and assigns the total to the first item as a new value.

>>=

Shifts the first item in binary representation the value of the second item of bits to the right, discarding bits shifted off, and assigns the new value to the first item.

<<=

Shifts the first item in binary representation the second item of bits to the left, shifting in zeros from the right, and assigns this total to the first item.

>>>=

Shifts the first item in binary representation the value of the second item bits to the right, discarding bits shifted off, shifting in zeros from the left, and assigns this total to the first item.

&=

Returns the value of the first item one in each bit position for which the corresponding bits of both operands are ones, and assigns the new value to the first item.

|=

Returns the value of the first item one in each bit position for which the corresponding bits of either or both operands are ones, and assigns the new value to the first item.

^=

Returns the value of the first item one in each bit position for which the corresponding bits of either but not both operands are ones, and assigns the new value to the first item.

&

Returns the value of the first item one in each bit position for which the corresponding bits of both operands are ones.

|

Returns the value of the first item one in each bit position for which the corresponding bits of either or both operands are ones.

^

Returns the value of the first item one in each bit position for which the corresponding bits of either but not both operands are ones.

~

Reverses the bits of the value.

<<

Shifts the first item in binary representation the second item of bits to the left, shifting in zeros from the right.

>>

No description provided.

>>>

Shifts the first item in binary representation the value of the second item bits to the right, discarding bits shifted off, shifting in zeros from the left

==

Returns true if both values are equal.

!=

Returns true if the two values are not equal.

===

Returns true if both values are of the same type and are equal.

!==

Returns true if the two values are either of different types or are different values.

>

Returns true if the value of the first item is greater than the value of the second item.

>=

Returns true if the value of the first item is greater or equal to than the value of the second item.

<

Returns true if the value of the first item is less than the value of the second item.

<=

Returns true if the value of the first item is less than or equal to the value of the second item.

&&

Returns true if both the first and second expression evaluate to true.

||

Returns true if either the first or second expression evaluate to true.

!

Inverts the boolean value of the expression.

,

Evaluates the value of the first expression, then the second expression, and returns the value of the second expression.

break

Breaks out of the current loop, switch, or labeled statement.

const

Declares a read-only constant.

condition ? ifTrue : ifFalse

Evaluates an expression, and does the first statement if the expression is true, or the second statement if the expression is false.

continue

In a while loop, jumps back to the condition statement. In a for loop, jumps to the update statement.

delete

Deletes an object, a property of an object, or an element in an array at the specified index.

do...while

Acts as a loop that continues to execute the doThis statement until the while expression is false.

export

Allows properties, functions, and objects from one script to be accessed by other scripts.

for

Executes a loop so that while expressionA is true, executes statementA and then evaluates expression B, then executes statementB if expressionB is true.

for...in

Loops through the properties of an object.

function

Declares a function.

if...else

If the expressionA is true, executes statementA. If the expression is false, evaluates expressionB. If expressionB is true, executes statementB. Otherwise, executes statementC.

import

Imports properties, functions, and objects from a script that has exported them.

in

Returns true if the specified property name can be found in the specified object.

instanceOf

Returns true if the specified object is of the specified object type.

label

Labels a statement with an identifier.

let

Labels a statement with an identifier.

new

Creates an instance of an object type that has a constructor function.

return

Specifies the value to be returned by a function.

switch

Evaluates an expression, and executes the statement(s) associated with the appropriate case for the value of the expression.

this

Refers to the calling object of a property.

throw

Specifies an exception to throw when an error occurs.

try...catch

Tries to execute the tryStatment, and executes the appropriate catch statement if there is an exception.

typeof

Returns the type of the specified variable.

var

Declares a variable and sets its initial value (if specified).

void

Evaluates the specified expression without returning a value.

while

Executes a statement while the specified expression is true.

with

Temporarily modifies the scope chain of a statement.

yield

Generator that returns the value for each step in a loop.