This part of the JavaScript section on MDN serves as a repository of facts about the JavaScript language. Read more about this reference.
This chapter documents all the JavaScript standard built-in objects, along with their methods and properties.
These global properties return a simple value; they have no properties or methods.
These global functions—functions which are called globally rather than on an object—directly return their results to the caller.
eval()uneval()
isFinite()isNaN()parseFloat()parseInt()decodeURI()decodeURIComponent()encodeURI()encodeURIComponent()escape()
unescape()
These are the fundamental, basic objects upon which all other objects are based. This includes objects that represent general objects, functions, and errors.
ObjectFunctionBooleanSymbolErrorEvalErrorInternalErrorRangeErrorReferenceErrorSyntaxErrorTypeErrorURIErrorThese are the base objects representing numbers, dates, and mathematical calculations.
These objects represent strings and support manipulating them.
These objects represent collections of data which are ordered by an index value. This includes (typed) arrays and array-like constructs.
ArrayInt8ArrayUint8ArrayUint8ClampedArrayInt16ArrayUint16ArrayInt32ArrayUint32ArrayFloat32ArrayFloat64ArrayThese objects represent collections which use keys; these contain elements which are iterable in the order of insertion.
These objects represent and interact with structured data buffers and data coded using JavaScript Object Notation (JSON).
Additions to the ECMAScript core for language-sensitive functionalities.
WebAssemblyWebAssembly.ModuleWebAssembly.InstanceWebAssembly.MemoryWebAssembly.TableWebAssembly.CompileErrorWebAssembly.LinkErrorWebAssembly.RuntimeErrorThis chapter documents all the JavaScript statements and declarations.
For an alphabetical listing see the sidebar on the left.
BlockbreakcontinueEmptyif...elseswitchthrowtry...catchvarletconstfunctionfunction*async functionreturnclassdo...whileforfor each...in
for...infor...offor await...ofwhiledebuggerexportimportimport.metalabelbreak or continue statement.with
This chapter documents all the JavaScript expressions and operators.
For an alphabetical listing see the sidebar on the left.
Basic keywords and general expressions in JavaScript.
thisthis keyword refers to a special property of an execution context.functionfunction keyword defines a function expression.classclass keyword defines a class expression.function*function* keyword defines a generator function expression.yieldyield*async functionasync function defines an async function expression.await[]{}/ab+c/i( )Left values are the destination of an assignment.
object.property and object["property"]).newnew operator creates an instance of a constructor.new.target refers to the constructor that was invoked by new.supersuper keyword calls the parent constructor....objPostfix/prefix increment and postfix/prefix decrement operators.
A++A--++A--AA unary operation is operation with only one operand.
deletedelete operator deletes a property from an object.voidvoid operator discards an expression's return value.typeoftypeof operator determines the type of a given object.+-~!Arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value.
+-/*%**A comparison operator compares its operands and returns a Boolean value based on whether the comparison is true.
inin operator determines whether an object has a given property.instanceofinstanceof operator determines whether an object is an instance of another object.<><=>=Note: => is not an operator, but the notation for Arrow functions.
The result of evaluating an equality operator is always of type Boolean based on whether the comparison is true.
Operations to shift all bits of the operand.
<<>>>>>Bitwise operators treat their operands as a set of 32 bits (zeros and ones) and return standard JavaScript numerical values.
Logical operators are typically used with boolean (logical) values, and when they are, they return a boolean value.
(condition ? ifTrue : ifFalse)The conditional operator returns one of two values based on the logical value of the condition.
An assignment operator assigns a value to its left operand based on the value of its right operand.
=*=/=%=+=-=<<=>>=>>>=&=^=|=[a, b] = [1, 2]{a, b} = {a:1, b:2}
Destructuring assignment allows you to assign the properties of an array or object to variables using syntax that looks similar to array or object literals.
,function keyword can be used to define a legacy generator function inside an expression. To make the function a legacy generator, the function body should contains at least one yield expression.[for (x of y) x] Obsolete since Gecko 58
(for (x of y) y) Obsolete since Gecko 58
This chapter documents how to work with JavaScript functions to develop your applications.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference