repo_id stringlengths 22 103 | file_path stringlengths 41 147 | content stringlengths 181 193k | __index_level_0__ int64 0 0 |
|---|---|---|---|
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/property_access_denied/index.md | ---
title: 'Error: Permission denied to access property "x"'
slug: Web/JavaScript/Reference/Errors/Property_access_denied
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "Permission denied to access property" occurs when there was
an attempt to access an object for which you have no p... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/deprecated_octal/index.md | ---
title: 'SyntaxError: "0"-prefixed octal literals and octal escape seq. are deprecated'
slug: Web/JavaScript/Reference/Errors/Deprecated_octal
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript [strict mode](/en-US/docs/Web/JavaScript/Reference/Strict_mode)-only exception "0-prefixed octal lite... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/missing_parenthesis_after_argument_list/index.md | ---
title: "SyntaxError: missing ) after argument list"
slug: Web/JavaScript/Reference/Errors/Missing_parenthesis_after_argument_list
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "missing ) after argument list" occurs when there is an error
with how a function is called. This might... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/missing_name_after_dot_operator/index.md | ---
title: "SyntaxError: missing name after . operator"
slug: Web/JavaScript/Reference/Errors/Missing_name_after_dot_operator
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "missing name after . operator" occurs when there is a problem
with how the dot operator (`.`) is used
for [pro... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/non_configurable_array_element/index.md | ---
title: "TypeError: can't delete non-configurable array element"
slug: Web/JavaScript/Reference/Errors/Non_configurable_array_element
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "can't delete non-configurable array element" occurs when it
was attempted to [shorten the length](/... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/hash_outside_class/index.md | ---
title: "SyntaxError: Unexpected '#' used outside of class body"
slug: Web/JavaScript/Reference/Errors/Hash_outside_class
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "Unexpected '#' used outside of class body" occurs when a hash
("#") is encountered in an unexpected context, mo... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/bad_regexp_flag/index.md | ---
title: 'SyntaxError: invalid regular expression flag "x"'
slug: Web/JavaScript/Reference/Errors/Bad_regexp_flag
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "invalid regular expression flag" occurs when the flags in a regular expression contain any flag that is not one of: `d`,... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/missing_semicolon_before_statement/index.md | ---
title: "SyntaxError: missing ; before statement"
slug: Web/JavaScript/Reference/Errors/Missing_semicolon_before_statement
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "missing ; before statement" occurs when there is a semicolon (`;`)
missing somewhere and can't be added
by [au... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/bigint_division_by_zero/index.md | ---
title: "RangeError: BigInt division by zero"
slug: Web/JavaScript/Reference/Errors/BigInt_division_by_zero
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "BigInt division by zero" occurs when a {{jsxref("BigInt")}} is divided by `0n`.
## Message
```plain
RangeError: Division by... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/is_not_iterable/index.md | ---
title: "TypeError: 'x' is not iterable"
slug: Web/JavaScript/Reference/Errors/is_not_iterable
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "is not iterable" occurs when the value which is given as the
right-hand side of [`for...of`](/en-US/docs/Web/JavaScript/Guide/Loops_and_it... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/reserved_identifier/index.md | ---
title: 'SyntaxError: "x" is a reserved identifier'
slug: Web/JavaScript/Reference/Errors/Reserved_identifier
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "_variable_ is a reserved identifier" occurs
when [reserved keywords](/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#k... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/not_a_function/index.md | ---
title: 'TypeError: "x" is not a function'
slug: Web/JavaScript/Reference/Errors/Not_a_function
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "is not a function" occurs when there was an attempt to call a
value from a function, but the value is not actually a function.
## Messag... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/reduce_of_empty_array_with_no_initial_value/index.md | ---
title: "TypeError: Reduce of empty array with no initial value"
slug: Web/JavaScript/Reference/Errors/Reduce_of_empty_array_with_no_initial_value
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "reduce of empty array with no initial value" occurs when a
reduce function is used.
#... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/bad_break/index.md | ---
title: "SyntaxError: unlabeled break must be inside loop or switch"
slug: Web/JavaScript/Reference/Errors/Bad_break
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "unlabeled break must be inside loop or switch" occurs when a {{jsxref("Statements/break", "break")}} statement is no... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/cant_redefine_property/index.md | ---
title: 'TypeError: can''t redefine non-configurable property "x"'
slug: Web/JavaScript/Reference/Errors/Cant_redefine_property
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "can't redefine non-configurable property" occurs when it was
attempted to redefine a property, but that p... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/negative_repetition_count/index.md | ---
title: "RangeError: repeat count must be non-negative"
slug: Web/JavaScript/Reference/Errors/Negative_repetition_count
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "repeat count must be non-negative" occurs when the
{{jsxref("String.prototype.repeat()")}} method is used with a ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/precision_range/index.md | ---
title: "RangeError: precision is out of range"
slug: Web/JavaScript/Reference/Errors/Precision_range
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "precision is out of range" occurs when a number that's
outside of the range of 0 and 20 (or 21) was passed into `toFixed` or
`toPre... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/bad_await/index.md | ---
title: "SyntaxError: await is only valid in async functions, async generators and modules"
slug: Web/JavaScript/Reference/Errors/Bad_await
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "await is only valid in async functions, async generators and modules" occurs when an {{jsxref... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/missing_formal_parameter/index.md | ---
title: "SyntaxError: missing formal parameter"
slug: Web/JavaScript/Reference/Errors/Missing_formal_parameter
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "missing formal parameter" occurs when your function
declaration is missing valid parameters.
## Message
```plain
SyntaxE... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/cant_be_converted_to_bigint_because_it_isnt_an_integer/index.md | ---
title: "RangeError: x can't be converted to BigInt because it isn't an integer"
slug: Web/JavaScript/Reference/Errors/Cant_be_converted_to_BigInt_because_it_isnt_an_integer
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "x can't be converted to BigInt because it isn't an integer"... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/invalid_date/index.md | ---
title: "RangeError: invalid date"
slug: Web/JavaScript/Reference/Errors/Invalid_date
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "invalid date" occurs when a string leading to an invalid date
has been provided to {{jsxref("Date")}} or {{jsxref("Date.parse()")}}.
## Message
`... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/cant_convert_bigint_to_number/index.md | ---
title: "TypeError: can't convert BigInt to number"
slug: Web/JavaScript/Reference/Errors/Cant_convert_BigInt_to_number
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "can't convert BigInt to number" occurs when an arithmetic operation involves a mix of {{jsxref("BigInt")}} and {{... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/bad_continue/index.md | ---
title: "SyntaxError: continue must be inside loop"
slug: Web/JavaScript/Reference/Errors/Bad_continue
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "continue must be inside loop" occurs when a {{jsxref("Statements/continue", "continue")}} statement is not inside a loop statement... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/illegal_character/index.md | ---
title: "SyntaxError: illegal character"
slug: Web/JavaScript/Reference/Errors/Illegal_character
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "illegal character" occurs when there is an invalid or
unexpected token that doesn't belong at this position in the code.
## Message
``... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/cant_delete/index.md | ---
title: 'TypeError: property "x" is non-configurable and can''t be deleted'
slug: Web/JavaScript/Reference/Errors/Cant_delete
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "property is non-configurable and can't be deleted" occurs
when it was attempted to delete a property, but t... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/array_sort_argument/index.md | ---
title: "TypeError: invalid Array.prototype.sort argument"
slug: Web/JavaScript/Reference/Errors/Array_sort_argument
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "invalid Array.prototype.sort argument" occurs when the argument of {{jsxref("Array.prototype.sort()")}} isn't either... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/no_variable_name/index.md | ---
title: "SyntaxError: missing variable name"
slug: Web/JavaScript/Reference/Errors/No_variable_name
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "missing variable name" is a common error.
It is usually caused by omitting a variable name or a typographic error.
## Message
```pl... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/redeclared_parameter/index.md | ---
title: 'SyntaxError: redeclaration of formal parameter "x"'
slug: Web/JavaScript/Reference/Errors/Redeclared_parameter
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "redeclaration of formal parameter" occurs when the same
variable name occurs as a function parameter and is then ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/not_a_valid_code_point/index.md | ---
title: "RangeError: argument is not a valid code point"
slug: Web/JavaScript/Reference/Errors/Not_a_valid_code_point
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript exception "Invalid code point" occurs when {{jsxref("NaN")}} values,
negative Integers (-1), non-Integers (5.4), or values lar... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/unterminated_string_literal/index.md | ---
title: "SyntaxError: unterminated string literal"
slug: Web/JavaScript/Reference/Errors/Unterminated_string_literal
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript error "unterminated string literal" occurs when there is an unterminated
[string literal](/en-US/docs/Web/JavaScript/Guide/Gram... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/errors | data/mdn-content/files/en-us/web/javascript/reference/errors/deprecated_caller_or_arguments_usage/index.md | ---
title: "ReferenceError: deprecated caller or arguments usage"
slug: Web/JavaScript/Reference/Errors/Deprecated_caller_or_arguments_usage
page-type: javascript-error
---
{{jsSidebar("Errors")}}
The JavaScript [strict mode](/en-US/docs/Web/JavaScript/Reference/Strict_mode)-only exception
"deprecated caller or argum... | 0 |
data/mdn-content/files/en-us/web/javascript/reference | data/mdn-content/files/en-us/web/javascript/reference/deprecated_and_obsolete_features/index.md | ---
title: Deprecated and obsolete features
slug: Web/JavaScript/Reference/Deprecated_and_obsolete_features
page-type: guide
---
{{jsSidebar("More")}}
This page lists features of JavaScript that are deprecated (that is, still available but planned for removal) and obsolete (that is, no longer usable).
## Deprecated ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference | data/mdn-content/files/en-us/web/javascript/reference/statements/index.md | ---
title: Statements and declarations
slug: Web/JavaScript/Reference/Statements
page-type: landing-page
browser-compat: javascript.statements
---
{{jsSidebar("Statements")}}
JavaScript applications consist of statements with an appropriate syntax. A single statement may span multiple lines. Multiple statements may o... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/empty/index.md | ---
title: Empty statement
slug: Web/JavaScript/Reference/Statements/Empty
page-type: javascript-statement
browser-compat: javascript.statements.empty
---
{{jsSidebar("Statements")}}
An **empty statement** is used to provide no statement, although the
JavaScript syntax would expect one.
{{EmbedInteractiveExample("pa... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/async_function/index.md | ---
title: async function
slug: Web/JavaScript/Reference/Statements/async_function
page-type: javascript-statement
browser-compat: javascript.statements.async_function
---
{{jsSidebar("Statements")}}
The **`async function`** declaration creates a {{Glossary("binding")}} of a new async function to a given name. The `a... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/export/index.md | ---
title: export
slug: Web/JavaScript/Reference/Statements/export
page-type: javascript-statement
browser-compat: javascript.statements.export
---
{{jsSidebar("Statements")}}
The **`export`** declaration is used to export values from a JavaScript module. Exported values can then be imported into other programs with ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/function/index.md | ---
title: function
slug: Web/JavaScript/Reference/Statements/function
page-type: javascript-statement
browser-compat: javascript.statements.function
---
{{jsSidebar("Statements")}}
The **`function`** declaration creates a {{Glossary("binding")}} of a new function to a given name.
You can also define functions using... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/try...catch/index.md | ---
title: try...catch
slug: Web/JavaScript/Reference/Statements/try...catch
page-type: javascript-statement
browser-compat: javascript.statements.try_catch
---
{{jsSidebar("Statements")}}
The **`try...catch`** statement is comprised of a `try` block and either a `catch` block, a `finally` block, or both. The code in... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/return/index.md | ---
title: return
slug: Web/JavaScript/Reference/Statements/return
page-type: javascript-statement
browser-compat: javascript.statements.return
---
{{jsSidebar("Statements")}}
The **`return`** statement ends function execution and specifies a value to be returned to the function caller.
{{EmbedInteractiveExample("pa... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/for...in/index.md | ---
title: for...in
slug: Web/JavaScript/Reference/Statements/for...in
page-type: javascript-statement
browser-compat: javascript.statements.for_in
---
{{jsSidebar("Statements")}}
The **`for...in`** statement iterates over all [enumerable string properties](/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_pr... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/do...while/index.md | ---
title: do...while
slug: Web/JavaScript/Reference/Statements/do...while
page-type: javascript-statement
browser-compat: javascript.statements.do_while
---
{{jsSidebar("Statements")}}
The **`do...while`** statement creates a loop that executes a
specified statement until the test condition evaluates to false. The c... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/class/index.md | ---
title: class
slug: Web/JavaScript/Reference/Statements/class
page-type: javascript-statement
browser-compat: javascript.statements.class
---
{{jsSidebar("Statements")}}
The **`class`** declaration creates a {{Glossary("binding")}} of a new [class](/en-US/docs/Web/JavaScript/Reference/Classes) to a given name.
Yo... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/for-await...of/index.md | ---
title: for await...of
slug: Web/JavaScript/Reference/Statements/for-await...of
page-type: javascript-statement
browser-compat: javascript.statements.for_await_of
---
{{jsSidebar("Statements")}}
The **`for await...of`** statement creates a loop iterating over [async iterable objects](/en-US/docs/Web/JavaScript/Ref... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/import/index.md | ---
title: import
slug: Web/JavaScript/Reference/Statements/import
page-type: javascript-statement
browser-compat: javascript.statements.import
---
{{jsSidebar("Statements")}}
The static **`import`** declaration is used to import read-only live {{Glossary("binding", "bindings")}} which are [exported](/en-US/docs/Web/... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/let/index.md | ---
title: let
slug: Web/JavaScript/Reference/Statements/let
page-type: javascript-statement
browser-compat: javascript.statements.let
---
{{jsSidebar("Statements")}}
The **`let`** declaration declares re-assignable, block-scoped local variables, optionally initializing each to a value.
{{EmbedInteractiveExample("pa... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/expression_statement/index.md | ---
title: Expression statement
slug: Web/JavaScript/Reference/Statements/Expression_statement
page-type: javascript-statement
spec-urls: https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-expression-statement
---
{{jsSidebar("Statements")}}
An **expression statement** is an ex... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/for...of/index.md | ---
title: for...of
slug: Web/JavaScript/Reference/Statements/for...of
page-type: javascript-statement
browser-compat: javascript.statements.for_of
---
{{jsSidebar("Statements")}}
The **`for...of`** statement executes a loop that operates on a sequence of values sourced from an [iterable object](/en-US/docs/Web/JavaS... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/const/index.md | ---
title: const
slug: Web/JavaScript/Reference/Statements/const
page-type: javascript-statement
browser-compat: javascript.statements.const
---
{{jsSidebar("Statements")}}
The **`const`** declaration declares block-scoped local variables. The value of a constant can't be changed through reassignment using the [assig... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/while/index.md | ---
title: while
slug: Web/JavaScript/Reference/Statements/while
page-type: javascript-statement
browser-compat: javascript.statements.while
---
{{jsSidebar("Statements")}}
The **`while`** statement creates a loop that executes a specified statement
as long as the test condition evaluates to true. The condition is ev... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/function_star_/index.md | ---
title: function*
slug: Web/JavaScript/Reference/Statements/function*
page-type: javascript-statement
browser-compat: javascript.statements.generator_function
---
{{jsSidebar("Statements")}}
The **`function*`** declaration creates a {{Glossary("binding")}} of a new generator function to a given name. A generator f... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/for/index.md | ---
title: for
slug: Web/JavaScript/Reference/Statements/for
page-type: javascript-statement
browser-compat: javascript.statements.for
---
{{jsSidebar("Statements")}}
The **`for`** statement creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/with/index.md | ---
title: with
slug: Web/JavaScript/Reference/Statements/with
page-type: javascript-statement
status:
- deprecated
browser-compat: javascript.statements.with
---
{{jsSidebar("Statements")}}{{Deprecated_Header}}
> **Note:** Use of the `with` statement is not recommended, as it may be the source of confusing bugs an... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/break/index.md | ---
title: break
slug: Web/JavaScript/Reference/Statements/break
page-type: javascript-statement
browser-compat: javascript.statements.break
---
{{jsSidebar("Statements")}}
The **`break`** statement terminates the current loop or {{jsxref("Statements/switch", "switch")}} statement and transfers program control to the... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/label/index.md | ---
title: Labeled statement
slug: Web/JavaScript/Reference/Statements/label
page-type: javascript-statement
browser-compat: javascript.statements.label
---
{{jsSidebar("Statements")}}
A **labeled statement** is any [statement](/en-US/docs/Web/JavaScript/Reference/Statements) that is prefixed with an identifier. You ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/switch/index.md | ---
title: switch
slug: Web/JavaScript/Reference/Statements/switch
page-type: javascript-statement
browser-compat: javascript.statements.switch
---
{{jsSidebar("Statements")}}
The **`switch`** statement evaluates an [expression](/en-US/docs/Web/JavaScript/Guide/Expressions_and_operators), matching the expression's va... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/var/index.md | ---
title: var
slug: Web/JavaScript/Reference/Statements/var
page-type: javascript-statement
browser-compat: javascript.statements.var
---
{{jsSidebar("Statements")}}
The **`var`** statement declares function-scoped or globally-scoped variables, optionally initializing each to a value.
{{EmbedInteractiveExample("pag... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/if...else/index.md | ---
title: if...else
slug: Web/JavaScript/Reference/Statements/if...else
page-type: javascript-statement
browser-compat: javascript.statements.if_else
---
{{jsSidebar("Statements")}}
The **`if...else`** statement executes a statement if a specified condition is {{Glossary("truthy")}}. If the condition is {{Glossary("... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/async_function_star_/index.md | ---
title: async function*
slug: Web/JavaScript/Reference/Statements/async_function*
page-type: javascript-statement
browser-compat: javascript.statements.async_generator_function
---
{{jsSidebar("Statements")}}
The **`async function*`** declaration creates a {{Glossary("binding")}} of a new async generator function ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/throw/index.md | ---
title: throw
slug: Web/JavaScript/Reference/Statements/throw
page-type: javascript-statement
browser-compat: javascript.statements.throw
---
{{jsSidebar("Statements")}}
The **`throw`** statement throws a user-defined exception. Execution of the current function will stop (the statements after `throw` won't be exe... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/debugger/index.md | ---
title: debugger
slug: Web/JavaScript/Reference/Statements/debugger
page-type: javascript-statement
browser-compat: javascript.statements.debugger
---
{{jsSidebar("Statements")}}
The **`debugger`** statement invokes any available debugging
functionality, such as setting a breakpoint. If no debugging functionality ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/continue/index.md | ---
title: continue
slug: Web/JavaScript/Reference/Statements/continue
page-type: javascript-statement
browser-compat: javascript.statements.continue
---
{{jsSidebar("Statements")}}
The **`continue`** statement terminates execution of the statements in the current iteration of the current or labeled loop, and continu... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/statements | data/mdn-content/files/en-us/web/javascript/reference/statements/block/index.md | ---
title: Block statement
slug: Web/JavaScript/Reference/Statements/block
page-type: javascript-statement
browser-compat: javascript.statements.block
---
{{jsSidebar("Statements")}}
A **block statement** is used to group zero or more statements. The block is delimited by a pair of braces ("curly braces") and contain... | 0 |
data/mdn-content/files/en-us/web/javascript/reference | data/mdn-content/files/en-us/web/javascript/reference/iteration_protocols/index.md | ---
title: Iteration protocols
slug: Web/JavaScript/Reference/Iteration_protocols
page-type: guide
spec-urls: https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteration
---
{{jsSidebar("More")}}
**Iteration protocols** aren't new built-ins or syntax, but _protocols_. These protocols can be imple... | 0 |
data/mdn-content/files/en-us/web/javascript/reference | data/mdn-content/files/en-us/web/javascript/reference/lexical_grammar/index.md | ---
title: Lexical grammar
slug: Web/JavaScript/Reference/Lexical_grammar
page-type: guide
browser-compat: javascript.grammar
spec-urls: https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html
---
{{jsSidebar("More")}}
This page describes JavaScript's lexical grammar. JavaScript source text is just... | 0 |
data/mdn-content/files/en-us/web/javascript/reference | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/index.md | ---
title: Regular expressions
slug: Web/JavaScript/Reference/Regular_expressions
page-type: landing-page
browser-compat: javascript.regular_expressions
---
{{jsSidebar}}
A **regular expression** (_regex_ for short) allow developers to match strings against a pattern, extract submatch information, or simply test if t... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/wildcard/index.md | ---
title: "Wildcard: ."
slug: Web/JavaScript/Reference/Regular_expressions/Wildcard
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.wildcard
---
{{jsSidebar}}
A **wildcard** matches all characters except line terminators. It also matches line terminators if the `s` flag is set.
... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/unicode_character_class_escape/index.md | ---
title: "Unicode character class escape: \\p{...}, \\P{...}"
slug: Web/JavaScript/Reference/Regular_expressions/Unicode_character_class_escape
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.unicode_character_class_escape
---
{{jsSidebar}}
A **unicode character class escape** ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/quantifier/index.md | ---
title: "Quantifier: *, +, ?, {n}, {n,}, {n,m}"
slug: Web/JavaScript/Reference/Regular_expressions/Quantifier
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.quantifier
---
{{jsSidebar}}
A **quantifier** repeats an [atom](/en-US/docs/Web/JavaScript/Reference/Regular_expression... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/character_class/index.md | ---
title: "Character class: [...], [^...]"
slug: Web/JavaScript/Reference/Regular_expressions/Character_class
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.character_class
---
{{jsSidebar}}
A **character class** matches any character in or not in a custom set of characters. Wh... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/backreference/index.md | ---
title: "Backreference: \\1, \\2"
slug: Web/JavaScript/Reference/Regular_expressions/Backreference
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.backreference
---
{{jsSidebar}}
A **backreference** refers to the submatch of a previous [capturing group](/en-US/docs/Web/JavaScr... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/capturing_group/index.md | ---
title: "Capturing group: (...)"
slug: Web/JavaScript/Reference/Regular_expressions/Capturing_group
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.capturing_group
---
{{jsSidebar}}
A **capturing group** groups a subpattern, allowing you to apply a [quantifier](/en-US/docs/Web... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/named_backreference/index.md | ---
title: "Named backreference: \\k<name>"
slug: Web/JavaScript/Reference/Regular_expressions/Named_backreference
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.named_backreference
---
{{jsSidebar}}
A **named backreference** refers to the submatch of a previous [named capturing... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/lookahead_assertion/index.md | ---
title: "Lookahead assertion: (?=...), (?!...)"
slug: Web/JavaScript/Reference/Regular_expressions/Lookahead_assertion
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.lookahead_assertion
---
{{jsSidebar}}
A **lookahead assertion** "looks ahead": it attempts to match the subseq... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/input_boundary_assertion/index.md | ---
title: "Input boundary assertion: ^, $"
slug: Web/JavaScript/Reference/Regular_expressions/Input_boundary_assertion
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.input_boundary_assertion
---
{{jsSidebar}}
An **input boundary assertion** checks if the current position in the... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/non-capturing_group/index.md | ---
title: "Non-capturing group: (?:...)"
slug: Web/JavaScript/Reference/Regular_expressions/Non-capturing_group
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.non_capturing_group
---
{{jsSidebar}}
A **non-capturing group** groups a subpattern, allowing you to apply a [quantifie... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/word_boundary_assertion/index.md | ---
title: "Word boundary assertion: \\b, \\B"
slug: Web/JavaScript/Reference/Regular_expressions/Word_boundary_assertion
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.word_boundary_assertion
---
{{jsSidebar}}
A **word boundary assertion** checks if the current position in the ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/disjunction/index.md | ---
title: "Disjunction: |"
slug: Web/JavaScript/Reference/Regular_expressions/Disjunction
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.disjunction
---
{{jsSidebar}}
A **disjunction** specifies multiple alternatives. Any alternative matching the input causes the entire disjunc... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/character_escape/index.md | ---
title: "Character escape: \\n, \\u{...}"
slug: Web/JavaScript/Reference/Regular_expressions/Character_escape
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.character_escape
---
{{jsSidebar}}
A **character escape** represents a character that may not be able to be convenientl... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/character_class_escape/index.md | ---
title: "Character class escape: \\d, \\D, \\w, \\W, \\s, \\S"
slug: Web/JavaScript/Reference/Regular_expressions/Character_class_escape
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.character_class_escape
---
{{jsSidebar}}
A **character class escape** is an escape sequence ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/literal_character/index.md | ---
title: "Literal character: a, b"
slug: Web/JavaScript/Reference/Regular_expressions/Literal_character
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.literal_character
---
{{jsSidebar}}
A **literal character** specifies exactly itself to be matched in the input text.
## Synt... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/named_capturing_group/index.md | ---
title: "Named capturing group: (?<name>...)"
slug: Web/JavaScript/Reference/Regular_expressions/Named_capturing_group
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.named_capturing_group
---
{{jsSidebar}}
A **named capturing group** is a particular kind of [capturing group](... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/regular_expressions | data/mdn-content/files/en-us/web/javascript/reference/regular_expressions/lookbehind_assertion/index.md | ---
title: "Lookbehind assertion: (?<=...), (?<!...)"
slug: Web/JavaScript/Reference/Regular_expressions/Lookbehind_assertion
page-type: javascript-language-feature
browser-compat: javascript.regular_expressions.lookbehind_assertion
---
{{jsSidebar}}
A **lookbehind assertion** "looks behind": it attempts to match the... | 0 |
data/mdn-content/files/en-us/web/javascript/reference | data/mdn-content/files/en-us/web/javascript/reference/operators/index.md | ---
title: Expressions and operators
slug: Web/JavaScript/Reference/Operators
page-type: landing-page
browser-compat: javascript.operators
---
{{jsSidebar("Operators")}}
This chapter documents all the JavaScript language operators, expressions and keywords.
## Expressions and operators by category
For an alphabetic... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/this/index.md | ---
title: this
slug: Web/JavaScript/Reference/Operators/this
page-type: javascript-language-feature
browser-compat: javascript.operators.this
---
{{jsSidebar("Operators")}}
A function's **`this`** keyword behaves a little differently in JavaScript compared to other languages. It also has some differences between [st... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/async_function/index.md | ---
title: async function expression
slug: Web/JavaScript/Reference/Operators/async_function
page-type: javascript-operator
browser-compat: javascript.operators.async_function
---
{{jsSidebar("Operators")}}
The **`async function`** keywords can be used to define an async function inside an expression.
You can also d... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/unsigned_right_shift/index.md | ---
title: Unsigned right shift (>>>)
slug: Web/JavaScript/Reference/Operators/Unsigned_right_shift
page-type: javascript-operator
browser-compat: javascript.operators.unsigned_right_shift
---
{{jsSidebar("Operators")}}
The **unsigned right shift (`>>>`)** operator returns a number whose binary representation is the ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/bitwise_and_assignment/index.md | ---
title: Bitwise AND assignment (&=)
slug: Web/JavaScript/Reference/Operators/Bitwise_AND_assignment
page-type: javascript-operator
browser-compat: javascript.operators.bitwise_and_assignment
---
{{jsSidebar("Operators")}}
The **bitwise AND assignment (`&=`)** operator performs [bitwise AND](/en-US/docs/Web/JavaScr... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/inequality/index.md | ---
title: Inequality (!=)
slug: Web/JavaScript/Reference/Operators/Inequality
page-type: javascript-operator
browser-compat: javascript.operators.inequality
---
{{jsSidebar("Operators")}}
The **inequality (`!=`)** operator checks whether its two operands are not
equal, returning a Boolean result.
Unlike the [strict ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/remainder/index.md | ---
title: Remainder (%)
slug: Web/JavaScript/Reference/Operators/Remainder
page-type: javascript-operator
browser-compat: javascript.operators.remainder
---
{{jsSidebar("Operators")}}
The **remainder (`%`)** operator returns the remainder left over when one operand is divided by a second operand. It always takes the... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/null/index.md | ---
title: "null"
slug: Web/JavaScript/Reference/Operators/null
page-type: javascript-language-feature
browser-compat: javascript.operators.null
---
{{jsSidebar("Operators")}}
The **`null`** value represents the intentional absence of any object value. It
is one of JavaScript's [primitive values](/en-US/docs/Glossary... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/conditional_operator/index.md | ---
title: Conditional (ternary) operator
slug: Web/JavaScript/Reference/Operators/Conditional_operator
page-type: javascript-operator
browser-compat: javascript.operators.conditional
---
{{jsSidebar("Operators")}}
The **conditional (ternary) operator** is the only JavaScript operator that takes three operands:
a con... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/left_shift_assignment/index.md | ---
title: Left shift assignment (<<=)
slug: Web/JavaScript/Reference/Operators/Left_shift_assignment
page-type: javascript-operator
browser-compat: javascript.operators.left_shift_assignment
---
{{jsSidebar("Operators")}}
The **left shift assignment (`<<=`)** operator performs [left shift](/en-US/docs/Web/JavaScript... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/decrement/index.md | ---
title: Decrement (--)
slug: Web/JavaScript/Reference/Operators/Decrement
page-type: javascript-operator
browser-compat: javascript.operators.decrement
---
{{jsSidebar("Operators")}}
The **decrement (`--`)** operator decrements (subtracts one from) its operand and returns the value before or after the decrement, d... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/function/index.md | ---
title: function expression
slug: Web/JavaScript/Reference/Operators/function
page-type: javascript-operator
browser-compat: javascript.operators.function
---
{{jsSidebar("Operators")}}
The **`function`** keyword can be used to define a function inside an expression.
You can also define functions using the [`func... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/destructuring_assignment/index.md | ---
title: Destructuring assignment
slug: Web/JavaScript/Reference/Operators/Destructuring_assignment
page-type: javascript-language-feature
browser-compat: javascript.operators.destructuring
---
{{jsSidebar("Operators")}}
The **destructuring assignment** syntax is a JavaScript expression that makes it possible to un... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/object_initializer/index.md | ---
title: Object initializer
slug: Web/JavaScript/Reference/Operators/Object_initializer
page-type: javascript-language-feature
browser-compat: javascript.operators.object_initializer
---
{{jsSidebar("Operators")}}
An **object initializer** is a comma-delimited list of zero or more pairs of property names and associ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/bitwise_or/index.md | ---
title: Bitwise OR (|)
slug: Web/JavaScript/Reference/Operators/Bitwise_OR
page-type: javascript-operator
browser-compat: javascript.operators.bitwise_or
---
{{jsSidebar("Operators")}}
The **bitwise OR (`|`)** operator returns a number or BigInt whose binary representation has a `1` in each bit position for which ... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/exponentiation_assignment/index.md | ---
title: Exponentiation assignment (**=)
slug: Web/JavaScript/Reference/Operators/Exponentiation_assignment
page-type: javascript-operator
browser-compat: javascript.operators.exponentiation_assignment
---
{{jsSidebar("Operators")}}
The **exponentiation assignment (`**=`)\*\* operator performs [exponentiation](/en-... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/less_than_or_equal/index.md | ---
title: Less than or equal (<=)
slug: Web/JavaScript/Reference/Operators/Less_than_or_equal
page-type: javascript-operator
browser-compat: javascript.operators.less_than_or_equal
---
{{jsSidebar("Operators")}}
The **less than or equal (`<=`)** operator returns `true` if the left operand is less than or equal to th... | 0 |
data/mdn-content/files/en-us/web/javascript/reference/operators | data/mdn-content/files/en-us/web/javascript/reference/operators/multiplication_assignment/index.md | ---
title: Multiplication assignment (*=)
slug: Web/JavaScript/Reference/Operators/Multiplication_assignment
page-type: javascript-operator
browser-compat: javascript.operators.multiplication_assignment
---
{{jsSidebar("Operators")}}
The **multiplication assignment (`*=`)** operator performs [multiplication](/en-US/d... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.