diff --git a/documentation/docs/backend/setDefaultDynamicBackendConfig.mdx b/documentation/docs/backend/setDefaultDynamicBackendConfig.mdx index 78b780060c..f4c5816ad3 100644 --- a/documentation/docs/backend/setDefaultDynamicBackendConfig.mdx +++ b/documentation/docs/backend/setDefaultDynamicBackendConfig.mdx @@ -17,15 +17,15 @@ The **`setDefaultDynamicBackendConfig()`** allows setting backend configuration - `connectTimeout` _: number_ _**optional**_ - Maximum duration in milliseconds to wait for a connection to this backend to be established. - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 + - Throws a [`RangeError`](../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - `firstByteTimeout` _: number_ _**optional**_ - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 + - Throws a [`RangeError`](../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - `betweenBytesTimeout` _: number_ _**optional**_ - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 + - Throws a [`RangeError`](../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - `useSSL` _: boolean_ _**optional**_ - Whether or not to require TLS for connections to this backend. - `dontPool` _: boolean_ _**optional**_ @@ -37,28 +37,28 @@ The **`setDefaultDynamicBackendConfig()`** allows setting backend configuration - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - Minimum allowed TLS version on SSL connections to this backend. - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 + - Throws a [`RangeError`](../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - Maximum allowed TLS version on SSL connections to this backend. - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 + - Throws a [`RangeError`](../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - `certificateHostname` _: string_ _**optional**_ - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. + - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is an empty string. - `caCertificate` _: string_ _**optional**_ - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. + - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is an empty string. - `ciphers` _: string_ _**optional**_ - List of OpenSSL ciphers to support for connections to this origin. - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. + - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is an empty string. - `clientCertificate` _: object_ _**optional**_ - The client certificate to provide for the TLS handshake - `certificate` _: string_ - The PEM certificate string. - `key` _: SecretStoreEntry_ - - The `SecretStoreEntry` to use for the key, created via [`SecretStore.prototype.get`](../../fastly:secret-store/SecretStore/prototype/get.mdx) or alteratively via [`SecretStore.fromBytes`](../../fastly:secret-store/SecretStore/fromBytes.mdx). + - The `SecretStoreEntry` to use for the key, created via [`SecretStore.prototype.get`](../fastly:secret-store/SecretStore/prototype/get.mdx) or alteratively via [`SecretStore.fromBytes`](../fastly:secret-store/SecretStore/fromBytes.mdx). - `httpKeepalive` _: number_ _**optional**_ - Enable HTTP keepalive, setting the timout in milliseconds. - `tcpKeepalive` _: boolean | object_ _**optional**_ diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/Backend.mdx deleted file mode 100644 index 3db45735ce..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/Backend.mdx +++ /dev/null @@ -1,188 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - ->**Note**: Dynamic backends are by default disabled at the Fastly service level. Contact [Fastly Support](https://support.fastly.com/hc/en-us/requests/new?ticket_form_id=360000269711) to request dynamic backends on Fastly Services. - -To disable the usage of dynamic backends, see [enforceExplicitBackends](../enforceExplicitBackends.mdx). - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `clientCertificate` _: object_ _**optional**_ - - The client certificate to provide for the TLS handshake - - `certificate` _: string_ - - The PEM certificate string. - - `key` _: SecretStoreEntry_ - - The `SecretStoreEntry` to use for the key, created via [`SecretStore.prototype.get`](../../fastly:secret-store/SecretStore/prototype/get.mdx) or alteratively via [`SecretStore.fromBytes`](../../fastly:secret-store/SecretStore/fromBytes.mdx). - - `httpKeepalive` _: number_ _**optional**_ - - Enable HTTP keepalive, setting the timout in milliseconds. - - `tcpKeepalive` _: boolean | object_ _**optional**_ - - Enable TCP keepalive. When an object, optionally setting the keepalive configuration options. - - `timeSecs` _: number_ _**optional**_ - - Configure how long to wait after the last sent data over the TCP connection before starting to send TCP keepalive probes. - - `intervalSecs` _: number_ _**optional**_ - - Configure how long to wait between each TCP keepalive probe sent to the backend to determine if it is still active. - - `probes` _: number_ _**optional**_ - - Number of probes to send to the backend before it is considered dead. - - `grpc` _: boolean_ _**optional**_ - - **_Experimental feature_** - - When enabled, sets that this backend is to be used for gRPC traffic. - - _Warning: When using this experimental feature, no guarantees are provided for behaviours for backends that do not provide gRPC traffic._ - -All optional generic options can have their defaults set via [`setDefaultDynamicBackendConfig()`](../setDefaultDynamicBackendConfig.mdx). - -This includes all configuration options above except for `name`, `target`, `hostOverride`, `sniHostname` and `grpc`. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - -import { Backend } from "fastly:backend"; -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - tlsMinVersion: 1.3, - tlsMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Backend } from "fastly:backend"; -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - tlsMinVersion: 1.3, - tlsMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/exists.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/exists.mdx deleted file mode 100644 index d4d75b304f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/exists.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.exists() - -The **`Backend.exists()`** method returns a boolean indicating if a Backend with the given name exists or not. - -## Syntax - -```js -exists(name) -``` - -### Return value - -A boolean indicating if a Backend with the given name exists or not. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/fromName.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/fromName.mdx deleted file mode 100644 index 471b6699dc..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/fromName.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.fromName() - -Returns the `Backend` instance with the given name, if one exists. If one does not exist, an error is thrown. - -## Syntax - -```js -fromName(name) -``` - -### Return value - -A `Backend` instance. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/health.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/health.mdx deleted file mode 100644 index 10bc633f0f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/health.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.health() - -:::info - -This method is deprecated, use [`Backend.prototype.health`](./prototype/health.mdx) instead. - -::: - -The **`Backend.health()`** method returns a string representing the health of the given Backend instance. - -## Syntax - -```js -Backend.health(backend) -``` - -### Return value - -A string representing the health of the specified Backend value. - -Possible values are: -- `"healthy"` - The backend's health check has succeeded, indicating the backend is working as expected and should receive requests. -- `"unhealthy"` - The backend's health check has failed, indicating the backend is not working as expected and should not receive requests. -- `"unknown"` - The backend does not have a health check configured. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/betweenBytesTimeout.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/betweenBytesTimeout.mdx deleted file mode 100644 index 0dfee514da..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/betweenBytesTimeout.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.betweenBytesTimeout - -The read-only **`betweenBytesTimeout`** property of a `Backend` instance is an integer number -providing the between bytes timeout for this backend in milliseconds. - -When not set or in environments that do not support this property (such as Viceroy), `null` -may be returned. - -## Value - -A `number` or `null`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/connectTimeout.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/connectTimeout.mdx deleted file mode 100644 index 3815bf7c54..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/connectTimeout.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.connectTimeout - -The read-only **`connectTimeout`** property of a `Backend` instance is an integer number -providing the connect timeout for this backend in milliseconds. - -When not set or in environments that do not support this property (such as Viceroy), `null` -may be returned. - -## Value - -A `number` or `null`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/firstByteTimeout.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/firstByteTimeout.mdx deleted file mode 100644 index 7fa0bbcc14..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/firstByteTimeout.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.firstByteTimeout - -The read-only **`firstByteTimeout`** property of a `Backend` instance is an integer number -providing the first byte timeout for this backend in milliseconds. - -When not set or in environments that do not support this property (such as Viceroy), `null` -may be returned. - -## Value - -A `number` or `null`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/health.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/health.mdx deleted file mode 100644 index 01021d99b1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/health.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.prototype.health() - -The **`Backend.prototype.health()`** method returns a string representing the health of the given Backend instance. - -## Syntax - -```js -health() -``` - -### Return value - -A string representing the health of the specified Backend value. - -Possible values are: -- `"healthy"` - The backend's health check has succeeded, indicating the backend is working as expected and should receive requests. -- `"unhealthy"` - The backend's health check has failed, indicating the backend is not working as expected and should not receive requests. -- `"unknown"` - The backend does not have a health check configured. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/hostOverride.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/hostOverride.mdx deleted file mode 100644 index 5463a53a6f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/hostOverride.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.hostOverride - -The read-only **`hostOverride`** property of a `Backend` instance is the host header -override string used when sending requests to this backend. - -## Value - -A `string`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/httpKeepaliveTime.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/httpKeepaliveTime.mdx deleted file mode 100644 index dcd2fb639d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/httpKeepaliveTime.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.httpKeepaliveTime - -The read-only **`httpKeepaliveTime`** property of a `Backend` instance is the HTTP keepalive -time for this backend in milliseconds, or 0 if no keepalive is set. - -## Value - -A `number`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/isDynamic.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/isDynamic.mdx deleted file mode 100644 index d62a0adc43..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/isDynamic.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.isDynamic - -The read-only **`isDynamic`** property of a `Backend` instance is a boolean -indicating if the backend was dynamically created for this service. - -## Value - -A `boolean`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/isSSL.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/isSSL.mdx deleted file mode 100644 index 8e3bfaeabe..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/isSSL.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.isSSL - -The read-only **`isSSL`** property of a `Backend` instance is a boolean -indicating if the backend is using an SSL connection. - -## Value - -A `boolean`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/name.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/name.mdx deleted file mode 100644 index bb4081114b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/name.mdx +++ /dev/null @@ -1,76 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# name - -The read-only **`name`** property of the backend returns the backend name string. - -## Value - -A `string`. - -## Description - -Provides the name of the backend. - -## Examples - -### Using name - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.name); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.name); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/port.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/port.mdx deleted file mode 100644 index cf3fe606de..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/port.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.port - -The read-only **`port`** property of a `Backend` instance is the port number -of this backend. - -## Value - -A `number`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/target.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/target.mdx deleted file mode 100644 index 4cd3743f4d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/target.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.target - -The read-only **`target`** property of a `Backend` instance is the host string -this backend is configured to use. - -## Value - -A `string`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/tcpKeepalive.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/tcpKeepalive.mdx deleted file mode 100644 index c86cfd359d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/tcpKeepalive.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.tcpKeepalive - -The read-only **`tcpKeepalive`** property of a `Backend` instance returns an object providing -the TCP keepalive configuration, if any, otherwise returning `null` if TCP keepalive is not enabled. - -This object has the following properties: -- `timeSecs` _: number or null. - - Configure how long to wait after the last sent data over the TCP connection before starting to send TCP keepalive probes. -- `intervalSecs` _: number or null. - - Configure how long to wait between each TCP keepalive probe sent to the backend to determine if it is still active. -- `probes` _: number or null. - - Number of probes to send to the backend before it is considered dead. - -## Value - -A `Object` or `null`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/tlsMaxVersion.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/tlsMaxVersion.mdx deleted file mode 100644 index bbd65eaae7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/tlsMaxVersion.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.tlsMaxVersion - -The read-only **`tlsMaxVersion`** property of a `Backend` instance is the max TLS version -it is configured to use, as a number, either `1.0`, `1.1`, `1.2`, or `1.3`. - -When not used, or for environments that do not support this feature, such as Viceroy, `null` -may be returned. - -## Value - -A `number` or `null`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/tlsMinVersion.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/tlsMinVersion.mdx deleted file mode 100644 index 258e058a7e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/tlsMinVersion.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.tlsMinVersion - -The read-only **`tlsMinVersion`** property of a `Backend` instance is the max TLS version -it is configured to use, as a number, either `1.0`, `1.1`, `1.2`, or `1.3`. - -When not used, or for environments that do not support this feature, such as Viceroy, `null` -may be returned. - -## Value - -A `number` or `null`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/toName.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/toName.mdx deleted file mode 100644 index 751cbef129..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/toName.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.prototype.toName() - -:::info - -This method is deprecated, use [`Backend.prototype.name`](./name.mdx) instead. - -::: - -The **`toName()`** method returns the name associated with the `Backend` instance. - -## Syntax - -```js -toName() -``` - -### Return value - -A string which contains the name of the Backend. diff --git a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/toString.mdx deleted file mode 100644 index 5e8bb1a987..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -:::info - -This method is deprecated, use [`Backend.prototype.name`](./name.mdx) instead. - -::: - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/backend/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.24.1/backend/allowDynamicBackends.mdx deleted file mode 100644 index ede53cc65f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/allowDynamicBackends.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -:::info - -This method is deprecated, and dynamic backends are now always supported when enabled at the service level. See [`enforceExplicitBackends`](./enforceExplicitBackends.mdx) instead. - -::: - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are enabled, but can be a potential security concern since third-party JavaScript code may send arbitrary requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending. - -Using `allowDynamicBackends(false)` this security property can be restored to only use explicit backend definitions. - ->**Note**: By default, while dynamic backends are allowed in the SDK, they are by default disabled at the Fastly service level. - -## Syntax - -```js -allowDynamicBackends(enabledOrConfig) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/enforceExplicitBackends.mdx b/documentation/versioned_docs/version-3.24.1/backend/enforceExplicitBackends.mdx deleted file mode 100644 index 9c4bf95ced..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/enforceExplicitBackends.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enforceExplicitBackends - -Call this function to enforce the security property of explicitly-defined backends, even when dynamic backends are enabled at -the Fastly service level. - -By default, if dynamic backends are supported for the Fastly service, they will be automatically used when creating a new -`fetch()` request. This default behaviour for dynamic backends can be a potential security concern since third-party JavaScript -code may send arbitrary requests, including sensitive/secret data, off to destinations that the JavaScript project was not -intending. - -When calling this function, an optional default backend name can be provided. - ->**Note**: This is a separate option to the service-level dynamic backend support for Fastly services, which is by deault disabled for Fastly services. - -The **`enforceExplicitBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are enabled, but can be a potential security concern since third-party JavaScript code may send arbitrary requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending. - -Using `allowDynamicBackends(false)` this security property can be restored to only use explicit backend definitions. - ->**Note**: Dynamic Backends are disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled or disabled on Fastly Services. - -## Syntax - -```js -enforceExplicitBackends(defaultBackend?) -``` - -### Parameters - -- `defaultBackend` _: string_ _**optional**_ - - An optional default backend string name to use in `fetch()` requests. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/backend/setDefaultDynamicBackendConfig.mdx b/documentation/versioned_docs/version-3.24.1/backend/setDefaultDynamicBackendConfig.mdx deleted file mode 100644 index 78b780060c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/backend/setDefaultDynamicBackendConfig.mdx +++ /dev/null @@ -1,167 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# setDefaultDynamicBackendConfig() - -The **`setDefaultDynamicBackendConfig()`** allows setting backend configuration defaults that should apply to any newly created dynamic backends via the `new Backend()` constructor. - -### Parameters - -- `defaultDynamicBackendConfig` - - - : An Object which contains the generic configuration options to apply to newly created Backends. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `clientCertificate` _: object_ _**optional**_ - - The client certificate to provide for the TLS handshake - - `certificate` _: string_ - - The PEM certificate string. - - `key` _: SecretStoreEntry_ - - The `SecretStoreEntry` to use for the key, created via [`SecretStore.prototype.get`](../../fastly:secret-store/SecretStore/prototype/get.mdx) or alteratively via [`SecretStore.fromBytes`](../../fastly:secret-store/SecretStore/fromBytes.mdx). - - `httpKeepalive` _: number_ _**optional**_ - - Enable HTTP keepalive, setting the timout in milliseconds. - - `tcpKeepalive` _: boolean | object_ _**optional**_ - - Enable TCP keepalive. When an object, optionally setting the keepalive configuration options. - - `timeSecs` _: number_ _**optional**_ - - Configure how long to wait after the last sent data over the TCP connection before starting to send TCP keepalive probes. - - `intervalSecs` _: number_ _**optional**_ - - Configure how long to wait between each TCP keepalive probe sent to the backend to determine if it is still active. - - `probes` _: number_ _**optional**_ - - Number of probes to send to the backend before it is considered dead. - -## Syntax - -```js -setDefaultDynamicBackendConfig(defaultConfig) -``` - -### Return value - -None. - -## Examples - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, with timeouts and TLS options provided from the default backend configuration options. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend, setDefaultDynamicBackendConfig } from "fastly:backend"; -allowDynamicBackends(true); -setDefaultDynamicBackendConfig({ - connectTimeout: 1000, - firstByteTimeout: 15_000, - betweenBytesTimeout: 10_000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3 -}); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - // Timeouts and TLS configuration still get set from the default backend configuration above. - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com" - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -setDefaultDynamicBackendConfig({ - connectTimeout: 1000, - firstByteTimeout: 15_000, - betweenBytesTimeout: 10_000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3 -}); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com" - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - diff --git a/documentation/versioned_docs/version-3.24.1/cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.24.1/cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/age.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/age.mdx deleted file mode 100644 index 582010180c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/age.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheEntry.age - -The **`age`** method of the `CacheEntry` interface returns the current age in milliseconds of the cached item. - -## Syntax - -```js -age() -``` - -### Parameters - -None. - -### Return value - -A `number` which represents the current age in milliseconds of the cached item. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/body.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/body.mdx deleted file mode 100644 index 820392aac0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/body.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheEntry.body - -The **`body`** method of the `CacheEntry` interface retrieves the cached item contents as a `ReadableStream`. - -Only one stream can be active at a time for a given `CacheEntry`. An error will be thrown if a stream is already active for this `CacheEntry`. - -## Syntax - -```js -body(options) -``` - -### Parameters - -- `options` _: object_ __optional__ - - `start` _: number_ - - The offset from which to start the range. - - `end` _: number_ - - How long the range should be. - -### Return value - -A `ReadableStream` which contains the cached item contents. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/close.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/close.mdx deleted file mode 100644 index aade06781d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/close.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheEntry.close - -The **`close`** method of the `CacheEntry` interface closes the connection to the cache for this `CacheEntry`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined` diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/hits.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/hits.mdx deleted file mode 100644 index 4e99b0933f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/hits.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheEntry.hits - -The **`hits`** method of the `CacheEntry` interface returns the amount of cache hits for the cached item. - -Note: this hit count only reflects the view of the server that supplied the cached item. Due to clustering, this count may vary between potentially many servers within the data center where the item is cached. See the [clustering documentation](https://developer.fastly.com/learning/vcl/clustering/) for details, though note that the exact caching architecture of Compute is different from VCL services. - -## Syntax - -```js -hits() -``` - -### Parameters - -None. - -### Return value - -A `number` which represents the number of cache hits to this cached item. diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/length.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/length.mdx deleted file mode 100644 index b0eed58d1c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/length.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheEntry.length - -The **`length`** method of the `CacheEntry` interface returns the size in bytes of the cached item, if known, otherwise returns `null` if the length is currently unknown. - -The length of the cached item may be unknown if the item is currently being streamed into the cache without a fixed length. - -## Syntax - -```js -length() -``` - -### Parameters - -None. - -### Return value - -A `number` or `null` which represents the current length of the cached item. - -`null` is returned if the length is currently unknown. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/maxAge.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/maxAge.mdx deleted file mode 100644 index f80b3f9a58..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/maxAge.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheEntry.maxAge - -The **`maxAge`** method of the `CacheEntry` interface returns the time in milliseconds for which the cached item is considered fresh. - -## Syntax - -```js -maxAge() -``` - -### Parameters - -None. - -### Return value - -A `number` which represents the time in milliseconds for which the cached item is considered fresh. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/staleWhileRevalidate.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/staleWhileRevalidate.mdx deleted file mode 100644 index ec636a112f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/staleWhileRevalidate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheEntry.staleWhileRevalidate - -The **`staleWhileRevalidate`** method of the `CacheEntry` interface returns the time in milliseconds for which a cached item can safely be used despite being considered stale. - -## Syntax - -```js -staleWhileRevalidate() -``` - -### Parameters - -None. - -### Return value - -A `number` which represents the time in milliseconds for which a cached item can safely be used despite being considered stale. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/state.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/state.mdx deleted file mode 100644 index c5f6526f3b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/state.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheEntry.state - -The **`state`** method of the `CacheEntry` interface returns a `CacheState` instance which reflects the current state of this `CacheEntry` instance. - -## Syntax - -```js -state() -``` - -### Parameters - -None. - -### Return value - -A `CacheState` instance which reflects the current state of this `CacheEntry` instance. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/userMetadata.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/userMetadata.mdx deleted file mode 100644 index d1a982de08..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheEntry/userMetadata.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheEntry.userMetadata - -The **`userMetadata`** method of the `CacheEntry` interface returns the user-controlled metadata associated with the cached item. - -## Syntax - -```js -userMetadata() -``` - -### Parameters - -None. - -### Return value - -An `ArrayBuffer` which contains the user-controlled metadata associated with the cached item. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheState/found.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheState/found.mdx deleted file mode 100644 index 60db770aa0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheState/found.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheState.found - -The **`found`** method of the `CacheState` interface returns `true` if a cached item was located. - -Even if an cached item is found, the cached item might be stale and require updating. Use `mustInsertOrUpdate()` to determine whether this transaction client is expected to update the cached item. - -## Syntax - -```js -found() -``` - -### Parameters - -None. - -### Return value - -A `boolean` which represents whether a cached item was located or not. diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheState/mustInsertOrUpdate.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheState/mustInsertOrUpdate.mdx deleted file mode 100644 index 70460755f9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheState/mustInsertOrUpdate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheState.mustInsertOrUpdate - -The **`mustInsertOrUpdate`** method of the `CacheState` interface returns `true` if a fresh cache item was not found, and this transaction client is expected to insert a new item or update a stale item. - - -## Syntax - -```js -mustInsertOrUpdate() -``` - -### Parameters - -None. - -### Return value - -A `boolean` which represents whether a fresh cached item was found not. diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheState/stale.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheState/stale.mdx deleted file mode 100644 index 22e0912d8f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheState/stale.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheState.stale - -The **`stale`** method of the `CacheState` interface returns `true` if the cached item is stale. - -A cached item is stale if its age is greater than its `maxAge` period. - -## Syntax - -```js -stale() -``` - -### Parameters - -None. - -### Return value - -A `boolean` which represents whether the cached item is stale or not. diff --git a/documentation/versioned_docs/version-3.24.1/cache/CacheState/usable.mdx b/documentation/versioned_docs/version-3.24.1/cache/CacheState/usable.mdx deleted file mode 100644 index 59d010e0b0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CacheState/usable.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CacheState.usable - -The **`usable`** method of the `CacheState` interface returns `true` if the cached item is usable. - -A cached item is usable if its age is less than the sum of the `maxAge` and `staleWhileRevalidate` periods. - -## Syntax - -```js -usable() -``` - -### Parameters - -None. - -### Return value - -A `boolean` which represents whether a cached item is usable or not. diff --git a/documentation/versioned_docs/version-3.24.1/cache/CoreCache/insert.mdx b/documentation/versioned_docs/version-3.24.1/cache/CoreCache/insert.mdx deleted file mode 100644 index 150d9c20f7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CoreCache/insert.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CoreCache.insert - -Performs a non-transactional insertion into the cache, returning a `FastlyBody` instance for providing the cached object itself. -For the insertion to complete successfully, the object must be written into the returned `FastlyBody` instance, and then `FastlyBody.protoype.close` must be called. -If `FastlyBody.prototype.close` does not get called, the insertion is considered incomplete, and any concurrent lookups that may be reading from the object as it is streamed into the cache may encounter a streaming error. - -Note: Like `CoreCache.lookup()`, `CoreCache.insert()` may race with concurrent lookups or insertions, and will unconditionally overwrite existing cached items rather than allowing for revalidation of an existing object. -The transactional equivalent of this function is `TransactionCacheEntry.insert()`, which may only be called following a `CoreCache.transactionLookup()` call and the returned `CacheEntry` when has a state where `CacheState.mustInsertOrUpdate()` returns true. - -## Syntax - -```js -insert(key, options) -``` - -### Parameters - -- `key` _: string_ - - A cache key which is a string with a length of up to 8,135 that identify a cached item. - - The cache key may not uniquely identify an item; headers can be used to augment the key when multiple items are associated with the same key. -- `options` _: object_ - - `headers` _: HeadersInit_ __optional__ - - The headers act as additional factors in object selection, and the choice of which headers to factor in is determined during insertion, via the `vary` property within `TransactionInsertOptions`. - - A lookup will succeed when there is at least one cached item that matches lookup’s `key`, and all of the lookup’s headers included in the cache items’ `vary` list match the corresponding headers in that cached item. - - A typical example is a cached HTTP response, where the request had an "Accept-Encoding" header. In that case, the origin server may or may not decide on a given encoding, and whether that same response is suitable for a request with a different (or missing) Accept-Encoding header is determined by whether Accept-Encoding is listed in Vary header in the origin’s response. - - Note: These headers are narrowly useful for implementing cache lookups incorporating the semantics of the HTTP Vary header. - - `maxAge` _: number_ __optional__ - - Sets the “time to live” for the cache item in milliseconds: The time for which the item will be considered fresh. - - `vary` _: array_ __optional__ - - Sets the list of headers that must match when looking up this cached item. - - `initialAge` _: number_ __optional__ - - Sets the initial age of the cached item, in milliseconds, to be used in freshness calculations. - - The initial age is 0 by default. - - `staleWhileRevalidate` _: number_ __optional__ - - Sets the stale-while-revalidate period, in milliseconds for the cached item, which is the time for which the item can be safely used despite being considered stale. - - Having a stale-while-revalidate period provides a signal that the cache should be updated (or its contents otherwise revalidated for freshness) asynchronously, while the stale cached item continues to be used, rather than blocking on updating the cached item. - - The methods `CacheState.protoype.usable` and `CacheState.protoype.stale` can be used to determine the current state of an item. - - The stale-while-revalidate period is 0 by default. - - `surrogateKeys` _: array_ __optional__ - - Sets the surrogate keys that can be used for purging this cached item. - - Surrogate key purges are the only means to purge specific items from the cache. At least one surrogate key must be set in order to remove an item without performing a purge-all, waiting for the item’s TTL to elapse, or overwriting the item with insert(). - - Surrogate keys must contain only printable ASCII characters (those between 0x21 and 0x7E, inclusive). Any invalid keys will be ignored. - - [See the Fastly surrogate keys guide for details.](https://docs.fastly.com/en/guides/working-with-surrogate-keys) - - `length` _: number_ __optional__ - - Sets the size of the cached item, in bytes, when known prior to actually providing the bytes. - - It is preferable to provide a length, if possible. - - Clients that begin streaming the item’s contents before it is completely provided will see the promised length which allows them to, for example, use content-length instead of transfer-encoding: chunked if the item is used as the body of a Request or Response. - - `userMetadata` _: ArrayBufferView | ArrayBuffer | URLSearchParams | string_ __optional__ - - Sets the user-defined metadata to associate with the cached item. - - `sensitive` _: boolean_ __optional__ - - Enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is false. - - [See the Fastly PCI-Compliant Caching and Delivery documentation for details.](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) - -### Return value - -Returns a `FastlyBody`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters diff --git a/documentation/versioned_docs/version-3.24.1/cache/CoreCache/lookup.mdx b/documentation/versioned_docs/version-3.24.1/cache/CoreCache/lookup.mdx deleted file mode 100644 index 23e15615fb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CoreCache/lookup.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# CoreCache.lookup - -Perform a non-transactional lookup into the cache, returning a CacheEntry if a usable cached item was found. -A cached item is usable if its age is less than the sum of its TTL and its stale-while-revalidate period. Items beyond that age are unusably stale. - -Note: A non-transactional lookup will not attempt to coordinate with any concurrent cache lookups. -If two instances of the service perform a lookup at the same time for the same cache key, and the item is not yet cached, they will both return `null`. -Without further coordination, they may both end up performing the work needed to insert() the item (which usually involves origin requests and/or computation) and racing with each other to insert. -To resolve such races between concurrent lookups, use `CoreCache.transactionLookup()` instead. - -## Syntax - -```js -lookup(key, options) -``` - -### Parameters - -- `key` _: string_ - - A cache key which is a string with a length of up to 8,135 that identify a cached item. - - The cache key may not uniquely identify an item; headers can be used to augment the key when multiple items are associated with the same key. - -- `options` _: object_ - - `headers` _: HeadersInit_ __optional__ - - The headers act as additional factors in object selection, and the choice of which headers to factor in is determined during insertion, via the `vary` property within `TransactionInsertOptions`. - - A lookup will succeed when there is at least one cached item that matches lookup’s `key`, and all of the lookup’s headers included in the cache items’ `vary` list match the corresponding headers in that cached item. - - A typical example is a cached HTTP response, where the request had an "Accept-Encoding" header. In that case, the origin server may or may not decide on a given encoding, and whether that same response is suitable for a request with a different (or missing) Accept-Encoding header is determined by whether Accept-Encoding is listed in Vary header in the origin’s response. - - Note: These headers are narrowly useful for implementing cache lookups incorporating the semantics of the HTTP Vary header. - -### Return value - -Returns `CacheEntry` if a usable cached item was found, otherwise returns `null`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - diff --git a/documentation/versioned_docs/version-3.24.1/cache/CoreCache/transactionLookup.mdx b/documentation/versioned_docs/version-3.24.1/cache/CoreCache/transactionLookup.mdx deleted file mode 100644 index b6d1bfbcd2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/CoreCache/transactionLookup.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# CoreCache.transactionLookup - -Perform a transactional lookup into the cache, returning a `TransactionCacheEntry` instance. - -Transactions coordinate between concurrent actions on the same cache key, incorporating concepts of [request collapsing](https://developer.fastly.com/learning/concepts/request-collapsing/) and [revalidation](https://developer.fastly.com/learning/concepts/stale/), though at a lower level that does not automatically interpret HTTP semantics. - -Request Collapsing: -If there are multiple concurrent calls to `CoreCache.transactionLookup()` for the same item and that item is not present, -just one of the callers will be instructed to insert the item into the cache as part of the transaction. -The other callers will block until the metadata for the item has been inserted, and can then begin streaming its contents out of the cache at the same time that the inserting caller streams them into the cache. - -Revalidation: -Similarly, if an item is usable but stale, and multiple callers attempt a `CoreCache.transactionLookup()` concurrently, they will all be given access to the stale item, but only one will be designated to perform an asynchronous update (or insertion) to freshen the item in the cache. - -## Syntax - -```js -transactionLookup(key, options) -``` - -### Parameters - -- `key` _: string_ - - A cache key which is a string with a length of up to 8,135 that identify a cached item. - - The cache key may not uniquely identify an item; headers can be used to augment the key when multiple items are associated with the same key. - -- `options` _: object_ - - `headers` _: HeadersInit_ __optional__ - - The headers act as additional factors in object selection, and the choice of which headers to factor in is determined during insertion, via the `vary` property within `TransactionInsertOptions`. - - A lookup will succeed when there is at least one cached item that matches lookup’s `key`, and all of the lookup’s headers included in the cache items’ `vary` list match the corresponding headers in that cached item. - - A typical example is a cached HTTP response, where the request had an "Accept-Encoding" header. In that case, the origin server may or may not decide on a given encoding, and whether that same response is suitable for a request with a different (or missing) Accept-Encoding header is determined by whether Accept-Encoding is listed in Vary header in the origin’s response. - - Note: These headers are narrowly useful for implementing cache lookups incorporating the semantics of the HTTP Vary header. - -### Return value - -Returns an instance of `TransactionCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - diff --git a/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/get.mdx deleted file mode 100644 index f547ac00d2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/get.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} -``` diff --git a/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index bb85d24c86..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key`. If no entry is found (or has expired), the supplied `set` function is executed and its result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - The function to execute if and only if the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView | ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The maximum number of seconds to store the supplied entry in the cache. - - `length` _: number_ __optional__ - - The length of the value being stored within the cache. This is only used when the `value` is a `ReadableStream`. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache. If the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/age.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/age.mdx deleted file mode 100644 index 276950a778..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/age.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.age - -The **`age`** method of the `TransactionCacheEntry` interface returns the current age in milliseconds of the cached item. - -## Syntax - -```js -age() -``` - -### Parameters - -None. - -### Return value - -A `number` which represents the current age in milliseconds of the cached item. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/body.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/body.mdx deleted file mode 100644 index 7ae107cde1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/body.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.body - -The **`body`** method of the `TransactionCacheEntry` interface retrieves the cached item contents as a `ReadableStream`. - -Only one stream can be active at a time for a given `TransactionCacheEntry`. An error will be thrown if a stream is already active for this `TransactionCacheEntry`. - -## Syntax - -```js -body(options) -``` - -### Parameters - -- `options` _: object_ __optional__ - - `start` _: number_ - - The offset from which to start the range. - - `end` _: number_ - - How long the range should be. - -### Return value - -A `ReadableStream` which contains the cached item contents. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/cancel.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/cancel.mdx deleted file mode 100644 index 08a127d0e2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/cancel.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.cancel - -The **`cancel`** method of the `TransactionCacheEntry` interface cancels an obligation to provide an object to the cache. - - -## Syntax - -```js -cancel() -``` - -### Parameters - -None. - -### Return value - -`undefined` diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/close.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/close.mdx deleted file mode 100644 index eb907c4305..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/close.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.close - -The **`close`** method of the `TransactionCacheEntry` interface closes the connection to the cache for this `TransactionCacheEntry`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined` diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/hits.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/hits.mdx deleted file mode 100644 index 3df3d77dba..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/hits.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.hits - -The **`hits`** method of the `TransactionCacheEntry` interface returns the amount of cache hits for the cached item. - -Note: this hit count only reflects the view of the server that supplied the cached item. Due to clustering, this count may vary between potentially many servers within the data center where the item is cached. See the [clustering documentation](https://developer.fastly.com/learning/vcl/clustering/) for details, though note that the exact caching architecture of Compute is different from VCL services. - -## Syntax - -```js -hits() -``` - -### Parameters - -None. - -### Return value - -A `number` which represents the number of cache hits to this cached item. diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/insert.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/insert.mdx deleted file mode 100644 index 40408eb12c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/insert.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.insert - -Perform a transactional cache insertion, returning a `FastlyBody` instance for providing the cached object itself. - -This method should only be called when `TransactionCacheEntry.state().mustInsertOrUpdate()` is true; otherwise, an error will be thrown when attempting to perform the insertion. - -## Syntax - -```js -insert(options) -``` - -### Parameters - -- `options` _: object_ - - `maxAge` _: number_ __optional__ - - Sets the “time to live” for the cache item in milliseconds: The time for which the item will be considered fresh. - - `vary` _: array_ __optional__ - - Sets the list of headers that must match when looking up this cached item. - - `initialAge` _: number_ __optional__ - - Sets the initial age of the cached item, in milliseconds, to be used in freshness calculations. - - The initial age is 0 by default. - - `staleWhileRevalidate` _: number_ __optional__ - - Sets the stale-while-revalidate period, in milliseconds for the cached item, which is the time for which the item can be safely used despite being considered stale. - - Having a stale-while-revalidate period provides a signal that the cache should be updated (or its contents otherwise revalidated for freshness) asynchronously, while the stale cached item continues to be used, rather than blocking on updating the cached item. - - The methods `CacheState.protoype.usable` and `CacheState.protoype.stale` can be used to determine the current state of an item. - - The stale-while-revalidate period is 0 by default. - - `surrogateKeys` _: array_ __optional__ - - Sets the surrogate keys that can be used for purging this cached item. - - Surrogate key purges are the only means to purge specific items from the cache. At least one surrogate key must be set in order to remove an item without performing a purge-all, waiting for the item’s TTL to elapse, or overwriting the item with insert(). - - Surrogate keys must contain only printable ASCII characters (those between 0x21 and 0x7E, inclusive). Any invalid keys will be ignored. - - [See the Fastly surrogate keys guide for details.](https://docs.fastly.com/en/guides/working-with-surrogate-keys) - - `length` _: number_ __optional__ - - Sets the size of the cached item, in bytes, when known prior to actually providing the bytes. - - It is preferable to provide a length, if possible. - - Clients that begin streaming the item's contents before it is completely provided will see the promised length which allows them to, for example, use content-length instead of transfer-encoding: chunked if the item is used as the body of a Request or Response. - - `userMetadata` _: ArrayBufferView | ArrayBuffer | URLSearchParams | string_ __optional__ - - Sets the user-defined metadata to associate with the cached item. - - `sensitive` _: boolean_ __optional__ - - Enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is false. - - [See the Fastly PCI-Compliant Caching and Delivery documentation for details.](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) - -### Return value - -Returns a `FastlyBody`. diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/insertAndStreamBack.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/insertAndStreamBack.mdx deleted file mode 100644 index 3cd423e955..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/insertAndStreamBack.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.insertAndStreamBack - -Perform a transaction cache insertion, returning a `FastlyBody` instance for providing the cached object itself, and a `CacheEntry` instance which can be used to stream out the newly-inserted cache item. - -For the insertion to complete successfully, the object must be written into the returned `FastlyBody` instance, and then `FastlyBody.protoype.close` must be called. -If `FastlyBody.prototype.close` does not get called, the insertion is considered incomplete, and any concurrent lookups that may be reading from the object as it is streamed into the cache may encounter a streaming error. - -## Syntax - -```js -insertAndStreamBack(options) -``` - -### Parameters - -- `options` _: object_ - - `maxAge` _: number_ __optional__ - - Sets the “time to live” for the cache item in milliseconds: The time for which the item will be considered fresh. - - `vary` _: array_ __optional__ - - Sets the list of headers that must match when looking up this cached item. - - `initialAge` _: number_ __optional__ - - Sets the initial age of the cached item, in milliseconds, to be used in freshness calculations. - - The initial age is 0 by default. - - `staleWhileRevalidate` _: number_ __optional__ - - Sets the stale-while-revalidate period, in milliseconds for the cached item, which is the time for which the item can be safely used despite being considered stale. - - Having a stale-while-revalidate period provides a signal that the cache should be updated (or its contents otherwise revalidated for freshness) asynchronously, while the stale cached item continues to be used, rather than blocking on updating the cached item. - - The methods `CacheState.protoype.usable` and `CacheState.protoype.stale` can be used to determine the current state of an item. - - The stale-while-revalidate period is 0 by default. - - `surrogateKeys` _: array_ __optional__ - - Sets the surrogate keys that can be used for purging this cached item. - - Surrogate key purges are the only means to purge specific items from the cache. At least one surrogate key must be set in order to remove an item without performing a purge-all, waiting for the item’s TTL to elapse, or overwriting the item with insert(). - - Surrogate keys must contain only printable ASCII characters (those between 0x21 and 0x7E, inclusive). Any invalid keys will be ignored. - - [See the Fastly surrogate keys guide for details.](https://docs.fastly.com/en/guides/working-with-surrogate-keys) - - `length` _: number_ __optional__ - - Sets the size of the cached item, in bytes, when known prior to actually providing the bytes. - - It is preferable to provide a length, if possible. - - Clients that begin streaming the item's contents before it is completely provided will see the promised length which allows them to, for example, use content-length instead of transfer-encoding: chunked if the item is used as the body of a Request or Response. - - `userMetadata` _: ArrayBufferView | ArrayBuffer | URLSearchParams | string_ __optional__ - - Sets the user-defined metadata to associate with the cached item. - - `sensitive` _: boolean_ __optional__ - - Enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is false. - - [See the Fastly PCI-Compliant Caching and Delivery documentation for details.](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) - -### Return value - -Returns an array where the first item is a `FastlyBody` instance and the second item is a `CacheEntry` instance. diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/length.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/length.mdx deleted file mode 100644 index c1a33ff3fb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/length.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.length - -The **`length`** method of the `TransactionCacheEntry` interface returns the size in bytes of the cached item, if known, otherwise returns `null` if the length is currently unknown. - -The length of the cached item may be unknown if the item is currently being streamed into the cache without a fixed length. - -## Syntax - -```js -length() -``` - -### Parameters - -None. - -### Return value - -A `number` or `null` which represents the current length of the cached item. - -`null` is returned if the length is currently unknown. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/maxAge.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/maxAge.mdx deleted file mode 100644 index cc447c7e91..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/maxAge.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.maxAge - -The **`maxAge`** method of the `TransactionCacheEntry` interface returns the time in milliseconds for which the cached item is considered fresh. - -## Syntax - -```js -maxAge() -``` - -### Parameters - -None. - -### Return value - -A `number` which represents the time in milliseconds for which the cached item is considered fresh. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/staleWhileRevalidate.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/staleWhileRevalidate.mdx deleted file mode 100644 index a02a712fe6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/staleWhileRevalidate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.staleWhileRevalidate - -The **`staleWhileRevalidate`** method of the `TransactionCacheEntry` interface returns the time in milliseconds for which a cached item can safely be used despite being considered stale. - -## Syntax - -```js -staleWhileRevalidate() -``` - -### Parameters - -None. - -### Return value - -A `number` which represents the time in milliseconds for which a cached item can safely be used despite being considered stale. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/state.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/state.mdx deleted file mode 100644 index 14689db330..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/state.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.state - -The **`state`** method of the `TransactionCacheEntry` interface returns a `CacheState` instance which reflects the current state of this `TransactionCacheEntry` instance. - -## Syntax - -```js -state() -``` - -### Parameters - -None. - -### Return value - -A `CacheState` instance which reflects the current state of this `TransactionCacheEntry` instance. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/update.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/update.mdx deleted file mode 100644 index d04ef0ea56..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/update.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.update - -Perform an update of the cache item's metadata. - -## Syntax - -```js -update(options) -``` - -### Parameters - -- `key` _: string_ - - A cache key which is a string with a length of up to 8,135 that identify a cached item. - - The cache key may not uniquely identify an item; headers can be used to augment the key when multiple items are associated with the same key. -- `options` _: object_ - - `maxAge` _: number_ __optional__ - - Sets the “time to live” for the cache item in milliseconds: The time for which the item will be considered fresh. - - `vary` _: array_ __optional__ - - Sets the list of headers that must match when looking up this cached item. - - `initialAge` _: number_ __optional__ - - Sets the initial age of the cached item, in milliseconds, to be used in freshness calculations. - - The initial age is 0 by default. - - `staleWhileRevalidate` _: number_ __optional__ - - Sets the stale-while-revalidate period, in milliseconds for the cached item, which is the time for which the item can be safely used despite being considered stale. - - Having a stale-while-revalidate period provides a signal that the cache should be updated (or its contents otherwise revalidated for freshness) asynchronously, while the stale cached item continues to be used, rather than blocking on updating the cached item. - - The methods `CacheState.protoype.usable` and `CacheState.protoype.stale` can be used to determine the current state of an item. - - The stale-while-revalidate period is 0 by default. - - `surrogateKeys` _: array_ __optional__ - - Sets the surrogate keys that can be used for purging this cached item. - - Surrogate key purges are the only means to purge specific items from the cache. At least one surrogate key must be set in order to remove an item without performing a purge-all, waiting for the item’s TTL to elapse, or overwriting the item with insert(). - - Surrogate keys must contain only printable ASCII characters (those between 0x21 and 0x7E, inclusive). Any invalid keys will be ignored. - - [See the Fastly surrogate keys guide for details.](https://docs.fastly.com/en/guides/working-with-surrogate-keys) - - `length` _: number_ __optional__ - - Sets the size of the cached item, in bytes, when known prior to actually providing the bytes. - - It is preferable to provide a length, if possible. - - Clients that begin streaming the item's contents before it is completely provided will see the promised length which allows them to, for example, use content-length instead of transfer-encoding: chunked if the item is used as the body of a Request or Response. - - `userMetadata` _: ArrayBufferView | ArrayBuffer | URLSearchParams | string_ __optional__ - - Sets the user-defined metadata to associate with the cached item. - -### Return value - -`undefined` diff --git a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/userMetadata.mdx b/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/userMetadata.mdx deleted file mode 100644 index 1689eb8744..0000000000 --- a/documentation/versioned_docs/version-3.24.1/cache/TransactionCacheEntry/userMetadata.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransactionCacheEntry.userMetadata - -The **`userMetadata`** method of the `TransactionCacheEntry` interface returns the user-controlled metadata associated with the cached item. - -## Syntax - -```js -userMetadata() -``` - -### Parameters - -None. - -### Return value - -An `ArrayBuffer` which contains the user-controlled metadata associated with the cached item. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/compute/purgeSurrogateKey.mdx b/documentation/versioned_docs/version-3.24.1/compute/purgeSurrogateKey.mdx deleted file mode 100644 index aa34ebe98e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/compute/purgeSurrogateKey.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# purgeSurrogateKey - -The **`purgeSurrogateKey()`** function is used to purge the given surrogate key string from Fastly's cache. - -There are two purge modes: soft purge and hard purge, with hard purge as the default which clears all items -from the cache immediately. When using a soft purge, stale entries are maintained in the cache, reducing -orgin load, while also enabling stale revalidations. - -See the [Fastly Purge Documentation](https://www.fastly.com/documentation/guides/concepts/edge-state/cache/purging/#surrogate-key-purge) for more information on caching and purge operations. - -## Syntax - -```js -purgeSurrogateKey(surrogateKey, soft?) -``` - -### Parameters - -- `surrogateKey` _: string_ - - The surrogate key string -- `soft?` _: boolean_ - - Enables a soft purge, retaining stale entries in the cache. Default is a hard purge. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/compute/vCpuTime.mdx b/documentation/versioned_docs/version-3.24.1/compute/vCpuTime.mdx deleted file mode 100644 index 9c22489afb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/compute/vCpuTime.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# vCpuTime - -The **`vCpuTime()`** function provides the vCPU time used by the current request handler in milliseconds. - -## Syntax - -```js -vCpuTime() -``` - -### Parameters - -None. - -### Return value - -`number`. diff --git a/documentation/versioned_docs/version-3.24.1/config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.24.1/config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.24.1/config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/lookup.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/lookup.mdx deleted file mode 100644 index 71db040fc9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/lookup.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Device.lookup() - -Look up the data associated with a particular User-Agent string. - - -## Syntax - -```js -lookup(userAgent) -``` - -### Return value - -If there is data associated with the User-Agent, a `Device` instance is returned. -Otherwise, `null` is returned. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/brand.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/brand.mdx deleted file mode 100644 index 0212b64fff..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/brand.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.brand - -The read-only **`brand`** property of the `Device` interface is -either a string stating the brand of the device, which can be different from the manufacturer of that device. -If no brand is known, the value will be `null`. - - -## Value - -Either a string value if a brand is known, otherwise `null`. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/hardwareType.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/hardwareType.mdx deleted file mode 100644 index dc383215f5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/hardwareType.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.hardwareType - -The read-only **`hardwareType`** property of the `Device` interface is -either a string stating the hardware type of the device, or `null` if the hardware type is not known. - -A string representation of the device's primary platform hardware. The most commonly used device types are also identified via boolean variables. Because a device may have multiple device types and this variable only has the primary type, we recommend using the boolean variables for logic and using this string representation for logging. - - - -## Value - -Either a string value if a hardware type is known, otherwise `null`. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isDesktop.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isDesktop.mdx deleted file mode 100644 index f5993762ce..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isDesktop.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.isDesktop - -The read-only **`isDesktop`** property of the `Device` interface is -either a boolean stating if the device is a desktop web browser, or `null` if the this is not known. - - -## Value - -Either a boolean stating if the device is a desktop web browser, or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isGameConsole.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isGameConsole.mdx deleted file mode 100644 index 839735ae4a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isGameConsole.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.isGameConsole - -The read-only **`isGameConsole`** property of the `Device` interface is -either a boolean stating if the device is a video game console, or `null` if the this is not known. - - -## Value - -Either a boolean stating if the device is a video game console, or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isMediaPlayer.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isMediaPlayer.mdx deleted file mode 100644 index 391c5dc168..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isMediaPlayer.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.isMediaPlayer - -The read-only **`isMediaPlayer`** property of the `Device` interface is -either a boolean stating if the device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo), or `null` if the this is not known. - - -## Value - -Either a boolean stating if the device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo), or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isMobile.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isMobile.mdx deleted file mode 100644 index 507ed050fc..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isMobile.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.isMobile - -The read-only **`isMobile`** property of the `Device` interface is -either a boolean stating if the device is a mobile phone, or `null` if the this is not known. - - -## Value - -Either a boolean stating if the device is a mobile phone, or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isSmartTV.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isSmartTV.mdx deleted file mode 100644 index 9619f66473..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isSmartTV.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.isSmartTV - -The read-only **`isSmartTV`** property of the `Device` interface is -either a boolean stating if the device is a smart TV, or `null` if the this is not known. - - -## Value - -Either a boolean stating if the device is a smart TV, or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isTablet.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isTablet.mdx deleted file mode 100644 index 429a1cceb9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isTablet.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.isTablet - -The read-only **`isTablet`** property of the `Device` interface is -either a boolean stating if the device is a tablet (like an iPad), or `null` if the this is not known. - - -## Value - -Either a boolean stating if the device is a tablet (like an iPad), or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isTouchscreen.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isTouchscreen.mdx deleted file mode 100644 index 3c951c2b76..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/isTouchscreen.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.isTouchscreen - -The read-only **`isTouchscreen`** property of the `Device` interface is -either a boolean stating if the device's screen is touch sensitive, or `null` if the this is not known. - - -## Value - -Either a boolean stating if the device's screen is touch sensitive, or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/model.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/model.mdx deleted file mode 100644 index 782c9cef60..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/model.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.model - -The read-only **`model`** property of the `Device` interface is -either a string stating the model of the device, or `null` if the model is not known. - - -## Value - -Either a string value if a model is known, otherwise `null`. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/name.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/name.mdx deleted file mode 100644 index 468c436c21..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/name.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Device.prototype.name - -The read-only **`name`** property of the `Device` interface is -either a string stating the name of the device, or `null` if the name is not known. - - -## Value - -Either a string value if a name is known, otherwise `null`. diff --git a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.24.1/device/Device/prototype/toJSON.mdx deleted file mode 100644 index 505c2e1734..0000000000 --- a/documentation/versioned_docs/version-3.24.1/device/Device/prototype/toJSON.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toJSON - -The `toJSON()` method of the Device interface is a serializer; -it returns a JSON representation of the Device object. - -To get a JSON string, you can use `JSON.stringify(device)` directly; it will call `toJSON()` automatically. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A JSON object that is the serialization of the Device object. diff --git a/documentation/versioned_docs/version-3.24.1/dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.24.1/dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index bbfc51fc6f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -:::info - -This Class is deprecated, it has been renamed to [`ConfigStore`](../../fastly:config-store/ConfigStore/ConfigStore.mdx) and can be imported via `import { ConfigStore } from 'fastly:config-store'` - -::: - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.24.1/dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index b80cef4fd9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,105 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -:::info - -This Class is deprecated, it has been renamed to [`ConfigStore`](../../../fastly:config-store/ConfigStore/ConfigStore.mdx) and can be imported via `import { ConfigStore } from 'fastly:config-store'` - -The `get()` method exists on the [`ConfigStore`](../../../fastly:config-store/ConfigStore/ConfigStore.mdx) Class. - -::: - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/EdgeRateLimiter/EdgeRateLimiter.mdx b/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/EdgeRateLimiter/EdgeRateLimiter.mdx deleted file mode 100644 index 32485b587c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/EdgeRateLimiter/EdgeRateLimiter.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `EdgeRateLimiter()` - -The **`EdgeRateLimiter` constructor** lets you open an epen a [ERL](https://docs.fastly.com/products/edge-rate-limiting) with the given ratecounter and penaltybox. - - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new EdgeRateLimiter(rateCounter, penaltyBox) -``` - -> **Note:** `EdgeRateLimiter()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `rateCounter` _: RateCounter_ - - The RateCounter instance to associate with this EdgeRateLimiter instance -- `penaltyBox` _: PenaltyBox_ - - The PenaltyBox instance which should be associated with this EdgeRateLimiter instance - -### Return value - -A new `EdgeRateLimiter` object. - -### Exceptions - -- `TypeError` - - Thrown if the provided rateCounter value is not an instance of RateCounter - - Thrown if the provided penaltyBox value is not an instance of PenaltyBox - diff --git a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/EdgeRateLimiter/prototype/checkRate.mdx b/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/EdgeRateLimiter/prototype/checkRate.mdx deleted file mode 100644 index f1f6a5004d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/EdgeRateLimiter/prototype/checkRate.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EdgeRateLimiter.prototype.checkRate - -Increment an entry in the rate counter and check if the entry has exceeded some average number of requests per second (RPS) over the given window. -If the entry is over the RPS limit for the window, add to the penaltybox for the given `timeToLive`. - -Valid `timeToLive` is 1 minute to 60 minutes and `timeToLive` value is truncated to the nearest minute. - -## Syntax -```js -checkRate(entry, delta, window, limit, timeToLive) -``` - -### Parameters - -- `entry` _: string_ - - The name of the entry to increment and check -- `delta` _: number_ - - The amount to increment the `entry` by -- `window` _: number_ - - The time period to check across, has to be either 1 second, 10 seconds, or 60 seconds -- `limit` _: number_ - - The requests-per-second limit -- `timeToLive` _: number_ - - In minutes, how long the entry should be added into the penalty-box - - Valid `timeToLive` is 1 minute to 60 minutes and `timeToLive` value is truncated to the nearest minute. - - -### Return value - -Returns `true` if the entry has exceeded the average RPS for the window, otherwise returns `false`. - -### Exceptions - -- `TypeError` - - Thrown if the provided `name` value can not be coerced into a string - - Thrown if the provided `delta` value is not a positive finite number. - - Thrown if the provided `window` value is not either, 1, 10, or 60. - - Thrown if the provided `limit` value is not a positive finite number. - - Thrown if the provided `timeToLive` value is not either, a number between 1 and 60 inclusively. - diff --git a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/PenaltyBox/PenaltyBox.mdx b/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/PenaltyBox/PenaltyBox.mdx deleted file mode 100644 index 17e1be9fb4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/PenaltyBox/PenaltyBox.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `PenaltyBox()` - -The **`PenaltyBox` constructor** can be used with a [Edge Rate Limiter](../EdgeRateLimiter/EdgeRateLimiter.mdx) or standalone for adding and checking if some entry is in the dataset. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new PenaltyBox(name) -``` - -> **Note:** `PenaltyBox()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - Open a PenaltyBox with the given name - - -### Return value - -A new `PenaltyBox` object instance. - -### Exceptions - -- `TypeError` - - Thrown if the provided `name` value can not be coerced into a string - diff --git a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/PenaltyBox/prototype/add.mdx b/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/PenaltyBox/prototype/add.mdx deleted file mode 100644 index 7dd8b9eb6c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/PenaltyBox/prototype/add.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# PenaltyBox.prototype.has - -Add an `entry` into the PenaltyBox for the duration of the given `timeToLive`. - -## Syntax -```js -add(entry, timeToLive) -``` - -### Parameters - -- `entry` _: string_ - - The name of the entry to look up -- `timeToLive` _: number_ - - In minutes, how long the entry should be added into the PenaltyBox - - Valid `timeToLive` is 1 minute to 60 minutes and `timeToLive` value is truncated to the nearest minute. - - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - Thrown if the provided `entry` value can not be coerced into a string - - Thrown if the provided `timeToLive` value is not either, a number between 1 and 60 inclusively. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/PenaltyBox/prototype/has.mdx b/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/PenaltyBox/prototype/has.mdx deleted file mode 100644 index 105e0c3b06..0000000000 --- a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/PenaltyBox/prototype/has.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# PenaltyBox.prototype.has - -Check if the given entry is contained in in the PenaltyBox instance. - -## Syntax -```js -has(entry) -``` - -### Parameters - -- `entry` _: string_ - - The name of the entry to look up - - -### Return value - -Returns `true` if the entry is contained in the PenaltyBox instance, otherwise returns `false`. - -### Exceptions - -- `TypeError` - - Thrown if the provided `entry` value can not be coerced into a string diff --git a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/RateCounter.mdx b/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/RateCounter.mdx deleted file mode 100644 index 04780a1fc0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/RateCounter.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `RateCounter()` - -The **`RateCounter` constructor** can be used with a [Edge Rate Limiter](../EdgeRateLimiter/EdgeRateLimiter.mdx) or standalone for counting and rate calculations. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new RateCounter(name) -``` - -> **Note:** `RateCounter()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - Open a RateCounter with the given name - - -### Return value - -A new `RateCounter` object instance. - -### Exceptions - -- `TypeError` - - Thrown if the provided `name` value can not be coerced into a string - diff --git a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/prototype/increment.mdx b/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/prototype/increment.mdx deleted file mode 100644 index 8bd5d00cf8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/prototype/increment.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RateCounter.prototype.increment - -Increment the given `entry` in the RateCounter instance with the given `delta` value. - -## Syntax -```js -increment(entry, delta) -``` - -### Parameters - -- `entry` _: string_ - - The name of the entry to look up -- `delta` _: number_ - - The amount to increment the entry by - - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - Thrown if the provided `entry` value can not be coerced into a string - - Thrown if the provided `delta` value is not a positive, finite number. diff --git a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/prototype/lookupCount.mdx b/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/prototype/lookupCount.mdx deleted file mode 100644 index 5b07777aec..0000000000 --- a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/prototype/lookupCount.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RateCounter.prototype.lookupCount - -Look up the current rate for the given `entry` and the given `duration`. - -## Syntax -```js -lookupCount(entry, duration) -``` - -### Parameters - -- `entry` _: string_ - - The name of the entry to look up -- `duration` _: number_ - - The duration to lookup alongside the entry, has to be either, 10, 20, 30, 40, 50, or 60 seconds. - - -### Return value - -Returns a number which is the count for the given `entry` and `duration` in this `RateCounter` instance. - -### Exceptions - -- `TypeError` - - Thrown if the provided `entry` value can not be coerced into a string - - Thrown if the provided `duration` value is not either, 10, 20, 30, 40, 50 or 60. diff --git a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/prototype/lookupRate.mdx b/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/prototype/lookupRate.mdx deleted file mode 100644 index 496d39cd21..0000000000 --- a/documentation/versioned_docs/version-3.24.1/edge-rate-limiter/RateCounter/prototype/lookupRate.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RateCounter.prototype.lookupRate - -Look up the current rate for the given `entry` and the given `window`. - -## Syntax -```js -lookupRate(entry, window) -``` - -### Parameters - -- `entry` _: string_ - - The name of the entry to look up -- `window` _: number_ - - The window to look up alongside the entry, has to be either 1 second, 10 seconds, or 60 seconds - - -### Return value - -Returns a number which is the rate for the given `entry` and `window` in this `RateCounter` instance. - -### Exceptions - -- `TypeError` - - Thrown if the provided `entry` value can not be coerced into a string - - Thrown if the provided `window` value is not either, 1, 10, or 60. diff --git a/documentation/versioned_docs/version-3.24.1/env/env.mdx b/documentation/versioned_docs/version-3.24.1/env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.24.1/experimental/allowDynamicBackends.mdx deleted file mode 100644 index 52a63a8505..0000000000 --- a/documentation/versioned_docs/version-3.24.1/experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,104 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabledOrConfig) -``` - -### Parameters - -- `enabledOrConfig` _: boolean_ - - Whether or not to allow Dynamic Backends - -or - -- `enabledOrConfig` _: object_ - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.24.1/experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.24.1/experimental/sdkVersion.mdx b/documentation/versioned_docs/version-3.24.1/experimental/sdkVersion.mdx deleted file mode 100644 index 04d06fc153..0000000000 --- a/documentation/versioned_docs/version-3.24.1/experimental/sdkVersion.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# sdkVersion - -The read-only **`sdkVersion`** property is a string whose indicates what JavaScript SDK version is being used. - -## Value - -A string value. diff --git a/documentation/versioned_docs/version-3.24.1/fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.24.1/fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.24.1/fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.24.1/geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.24.1/geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index bdd7621521..0000000000 --- a/documentation/versioned_docs/version-3.24.1/geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,180 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object`, or `null` if no geolocation data was found. - -The object contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.24.1/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/from.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/of.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.24.1/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.24.1/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.24.1/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.24.1/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.24.1/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.24.1/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.24.1/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.24.1/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.24.1/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.24.1/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.24.1/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.24.1/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.24.1/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.24.1/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.24.1/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.24.1/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.24.1/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.24.1/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.24.1/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.24.1/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/now.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.24.1/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.24.1/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.24.1/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.24.1/globals/EcKeyImportParams/EcKeyImportParams.mdx b/documentation/versioned_docs/version-3.24.1/globals/EcKeyImportParams/EcKeyImportParams.mdx deleted file mode 100644 index ba566b82d2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/EcKeyImportParams/EcKeyImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EcKeyImportParams - -The **`EcKeyImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when generating any elliptic-curve-based key pair: that is, when the algorithm is identified as ECDSA. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `namedCurve` - - - : A string representing the name of the elliptic curve to use. This may be any of the following names for [NIST](https://www.nist.gov/)-approved curves: - - - `P-256` - - `P-384` - - `P-521` diff --git a/documentation/versioned_docs/version-3.24.1/globals/EcdsaParams/EcdsaParams.mdx b/documentation/versioned_docs/version-3.24.1/globals/EcdsaParams/EcdsaParams.mdx deleted file mode 100644 index 5594d480f9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/EcdsaParams/EcdsaParams.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# EcdsaParams - -The **`EcdsaParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.sign()` or `SubtleCrypto.verify()` when using the ECDSA algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `hash` - - - : A string. An identifier for the digest algorithm to use. This should be one of the following: - - - `SHA-256`: selects the SHA-256 algorithm. - - `SHA-384`: selects the SHA-384 algorithm. - - `SHA-512`: selects the SHA-512 algorithm. - - > **Warning:** `SHA-1` is also supported here but the SHA-1 algorithm is considered vulnerable and should no longer be used. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.24.1/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.24.1/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.24.1/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.24.1/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.24.1/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 1ed6ba0637..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - While these fields are always defined on Compute, they may be *null* when not available in testing environments - such as Viceroy. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : Either `null`, or a [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - - `FetchEvent.client.tlsJA3MD5` _**readonly**_ - - : Either `null` or a string representation of the JA3 hash of the TLS ClientHello message. - - `FetchEvent.client.tlsCipherOpensslName` _**readonly**_ - - : Either `null` or a string representation of the cipher suite used to secure the client TLS connection. - - `FetchEvent.client.tlsProtocol` _**readonly**_ - - : Either `null` or a string representation of the TLS protocol version used to secure the client TLS connection. - - `FetchEvent.client.tlsClientCertificate` _**readonly**_ - - : Either `null` or an ArrayBuffer containing the raw client certificate in the mutual TLS handshake message. It is in PEM format. Returns an empty ArrayBuffer if this is not mTLS or available. - - `FetchEvent.client.tlsClientHello` _**readonly**_ - - : Either `null` or an ArrayBuffer containing the raw bytes sent by the client in the TLS ClientHello message. -- `FetchEvent.server` _**readonly**_ - - : Information about the server receiving the request for the Fastly Compute service. - - `FetchEvent.server.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the server which received the request. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.24.1/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.24.1/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.24.1/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.24.1/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.24.1/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.24.1/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.24.1/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.24.1/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.24.1/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/getSetCookie.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/getSetCookie.mdx deleted file mode 100644 index b7618675b8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/getSetCookie.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.getSetCookie() - -The **`getSetCookie()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns an array of all the values of the `Set-Cookie` headers, returning -an empty list if none are present. - -## Syntax - -```js -getSetCookie() -``` - -### Return value - -`String[]` representing the list of `Set-Cookie` headers. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.24.1/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.24.1/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Infinity.mdx b/documentation/versioned_docs/version-3.24.1/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.24.1/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.24.1/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.24.1/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/E.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/log.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/max.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/min.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/random.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/round.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.24.1/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/NaN.mdx b/documentation/versioned_docs/version-3.24.1/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/create.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/is.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Object/values.mdx b/documentation/versioned_docs/version-3.24.1/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.24.1/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.24.1/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.24.1/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.24.1/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.24.1/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/Request.mdx deleted file mode 100644 index 3ace40c683..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/Request.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `manualFramingHeaders`_: boolean_ _**optional**_ _**Fastly-specific**_ - - : The default value is `false`, which means that the framing headers are automatically created based on the message body. - In "automatic" mode, a `Content-Length` is used when the size of the body can be determined before it is sent. - Requests sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a `Transfer-Encoding: chunked` to accommodate the dynamic generation of the body. - In "manual" mode, any `Content-Length` or `Transfer-Encoding` headers will be honored. - You must ensure that those headers have correct values permitted by the [HTTP/1.1 specification](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1). - If the provided headers are not permitted by the specification, the headers will revert to "automatic" mode and a diagnostic message will be logged about what was wrong. - If a `Content-Length` is permitted by the specification, but the value does not match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short). - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/clone.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/clone.mdx deleted file mode 100644 index e08220c446..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/clone.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.clone() - -The **`clone()`** method of the `Request` interface creates a copy of the current `Request` object. - -Like the underlying `ReadableStream.tee`` api, the `body` of a cloned `Response` -will signal backpressure at the rate of the _faster_ consumer of the two bodies, -and unread data is enqueued internally on the slower consumed `body` -without any limit or backpressure. -Beware when you construct a `Request` from a stream and then `clone` it. - -`clone()` throws a `TypeError` if the request body has already been used. In fact, the main reason `clone()` exists is to allow multiple uses of body objects (when they are one-use only.) - -If you intend to modify the request, you may prefer the `Request` constructor. - -## Syntax - -```js -clone() -``` - -### Parameters - -None. - -### Return value - -A `Request` object, which is an exact copy of the `Request` that `clone()` was called on. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/setManualFramingHeaders.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/setManualFramingHeaders.mdx deleted file mode 100644 index ac6a403a55..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/setManualFramingHeaders.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.setManualFramingHeaders() - -The **`setManualFramingHeaders()`** method of the `Request` interface controls how the framing headers should be determined. - -By default the framing headers are set to "automatic" mode, which means they are created based on the body of the associated Request instance. -In "automatic" mode, a `Content-Length` is used when the size of the body can be determined before it is sent. -Requests sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a `Transfer-Encoding: chunked` to accommodate the dynamic generation of the body. -In "manual" mode, any `Content-Length` or `Transfer-Encoding` headers will be honored. -You must ensure that those headers have correct values permitted by the [HTTP/1.1 specification](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1). -If the provided headers are not permitted by the specification, the headers will revert to "automatic" mode and a diagnostic message will be logged about what was wrong. -If a `Content-Length` is permitted by the specification, but the value does not match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short). - -## Syntax - -## Syntax - -```js -setManualFramingHeaders(manual) -``` - -### Parameters - -- `manual` _: boolean_ - - : Whether or not to use "manual" mode for the framing headers. - -### Return value - -`undefined`. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/Response.mdx deleted file mode 100644 index 0e0a174fac..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/Response.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. - - `manualFramingHeaders`_: boolean_ _**optional**_ _**Fastly-specific**_ - - : The default value is `false`, which means that the framing headers are automatically created based on the message body. - In "automatic" mode, a `Content-Length` is used when the size of the body can be determined before it is sent. - Responses sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a `Transfer-Encoding: chunked` to accommodate the dynamic generation of the body. - In "manual" mode, any `Content-Length` or `Transfer-Encoding` headers will be honored. - You must ensure that those headers have correct values permitted by the [HTTP/1.1 specification](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1). - If the provided headers are not permitted by the specification, the headers will revert to "automatic" mode and a diagnostic message will be logged about what was wrong. - If a `Content-Length` is permitted by the specification, but the value does not match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/ip.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/ip.mdx deleted file mode 100644 index e028e2de2f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/ip.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ip - -The **`ip`** getter of the `Response` interface returns the IP address associated with the request, as either an IPv6 or IPv4 string. - -In the case where no IP address is available (say the response is cached, or was manually created), `undefined` will be returned. - -To ensure an origin request with an IP, pass a [`CacheOverride`](../../../fastly:cache-override/CacheOverride/CacheOverride.mdx) value. - -## Value - -`undefined` or `string`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/port.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/port.mdx deleted file mode 100644 index 81ac10da16..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/port.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.port - -The **`port`** getter of the `Response` interface returns the port associated with the request, as a number. - -In the case where no port is available (say the response is cached, or was manually created), `undefined` will be returned. - -To ensure an origin request with a port, pass a [`CacheOverride`](../../../fastly:cache-override/CacheOverride/CacheOverride.mdx) value. - -## Value - -`undefined` or `number`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/setManualFramingHeaders.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/setManualFramingHeaders.mdx deleted file mode 100644 index eee2c623c4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/setManualFramingHeaders.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.setManualFramingHeaders() - -The **`setManualFramingHeaders()`** method of the `Response` interface controls how the framing headers should be determined. - -By default the framing headers are set to "automatic" mode, which means they are created based on the body of the associated Response instance. -In "automatic" mode, a `Content-Length` is used when the size of the body can be determined before it is sent. -Responses sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a `Transfer-Encoding: chunked` to accommodate the dynamic generation of the body. -In "manual" mode, any `Content-Length` or `Transfer-Encoding` headers will be honored. -You must ensure that those headers have correct values permitted by the [HTTP/1.1 specification](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1). -If the provided headers are not permitted by the specification, the headers will revert to "automatic" mode and a diagnostic message will be logged about what was wrong. -If a `Content-Length` is permitted by the specification, but the value does not match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short). - -## Syntax - -```js -setManualFramingHeaders(manual) -``` - -### Parameters - -- `manual` _: boolean_ - - : Whether or not to use "manual" mode for the framing headers. - -### Return value - -`undefined`. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.24.1/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.24.1/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.24.1/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/String.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.24.1/globals/String/raw.mdx b/documentation/versioned_docs/version-3.24.1/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 7253643753..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. - - For ECDSA: - Pass an [`EcKeyImportParams`](../../EcKeyImportParams/EcKeyImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.24.1/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.24.1/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.24.1/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.24.1/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.24.1/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.24.1/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.24.1/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.24.1/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.24.1/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.24.1/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.24.1/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.24.1/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.24.1/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.24.1/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.24.1/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.24.1/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.24.1/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.24.1/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.24.1/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.24.1/globals/atob.mdx b/documentation/versioned_docs/version-3.24.1/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.24.1/globals/btoa.mdx b/documentation/versioned_docs/version-3.24.1/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.24.1/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.24.1/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.24.1/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/assert.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/clear.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/count.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/debug.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/dir.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/error.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/group.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/info.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/log.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/time.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/trace.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/console/warn.mdx b/documentation/versioned_docs/version-3.24.1/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.24.1/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.24.1/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.24.1/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.24.1/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.24.1/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.24.1/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.24.1/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.24.1/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.24.1/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.24.1/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/escape.mdx b/documentation/versioned_docs/version-3.24.1/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.24.1/globals/eval.mdx b/documentation/versioned_docs/version-3.24.1/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.24.1/globals/fetch.mdx b/documentation/versioned_docs/version-3.24.1/globals/fetch.mdx deleted file mode 100644 index a8f05b89b3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/fetch.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Explicit Backends - -Internally, Fastly uses named backends to handle fetch requests, which need to be explicitly defined to enable custom HTTP origins to be fetched by the service. - -This `backend` option is then a special Fastly-specific fetch option that is provided to the `fetch()` call: - -```js -fetch('https://origin.com/path', { backend: 'origin' }); -``` - -Backends are configured using the Fastly service backend configuration, see the [Backend documentation](https://developer.fastly.com/reference/api/services/backend/) for more information. - -## Dynamic Backends - -Dynamic backends are a compute feature that allow services to define backends for themselves. This is a service-level Fastly feature that must be enabled through [Fastly Support](https://support.fastly.com/hc/en-us/requests/new?ticket_form_id=360000269711). - -When dynamic backends are enabled at the service level, the explicit `backend` option is no longer required for `fetch()` requests, and will instead be automatically created. - -In addition, custom backend confiuration options can then also be provided through the [`Backend()`](../fastly:backend/Backend/Backend.mdx) constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/globalThis.mdx b/documentation/versioned_docs/version-3.24.1/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.24.1/globals/isFinite.mdx b/documentation/versioned_docs/version-3.24.1/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/isNaN.mdx b/documentation/versioned_docs/version-3.24.1/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.24.1/globals/location.mdx b/documentation/versioned_docs/version-3.24.1/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.24.1/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.24.1/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.24.1/globals/parseInt.mdx b/documentation/versioned_docs/version-3.24.1/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/performance/now.mdx b/documentation/versioned_docs/version-3.24.1/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.24.1/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.24.1/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/globals/setInterval.mdx b/documentation/versioned_docs/version-3.24.1/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.24.1/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.24.1/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.24.1/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.24.1/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.24.1/globals/undefined.mdx b/documentation/versioned_docs/version-3.24.1/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.24.1/globals/unescape.mdx b/documentation/versioned_docs/version-3.24.1/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.24.1/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.24.1/index.mdx b/documentation/versioned_docs/version-3.24.1/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.24.1/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/KVStore.mdx deleted file mode 100644 index 6cac3d4b05..0000000000 --- a/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/edge-state/data-stores#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/prototype/delete.mdx b/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/prototype/delete.mdx deleted file mode 100644 index 255faac0b2..0000000000 --- a/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/prototype/delete.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.delete - -Deletes the value associated with the key `key` in the KV store. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -Returns `undefined` - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - - Does not exist - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then delete the entry. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - await files.delete('hello') - - const entry = await files.get('hello') - if (entry) { - return new Response(await entry.text()) - } else { - return new Response('no file named hello exists') - } - -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index 9504041ce1..0000000000 --- a/documentation/versioned_docs/version-3.24.1/kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.24.1/kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.24.1/logger/Logger/Logger.mdx deleted file mode 100644 index bd7ed9b585..0000000000 --- a/documentation/versioned_docs/version-3.24.1/logger/Logger/Logger.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -const logger = new Logger("splunk"); -async function app (event) { - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.24.1/logger/Logger/prototype/log.mdx deleted file mode 100644 index f64a83360a..0000000000 --- a/documentation/versioned_docs/version-3.24.1/logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -let logger = new Logger("splunk"); -async function app (event) { - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/migration-guide/index.mdx b/documentation/versioned_docs/version-3.24.1/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.24.1/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.24.1/secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.24.1/secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.24.1/secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.24.1/secret-store/SecretStore/fromBytes.mdx b/documentation/versioned_docs/version-3.24.1/secret-store/SecretStore/fromBytes.mdx deleted file mode 100644 index 4aa5c85808..0000000000 --- a/documentation/versioned_docs/version-3.24.1/secret-store/SecretStore/fromBytes.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fromBytes - -The **`fromBytes()`** function is used to create an in-memory secret from an array buffer. - ->**Note**: This API should be avoided when possible, by instead using [SecretStore.prototype.get](./prototype/get.mdx) to obtain secure secrets. - -## Syntax - -```js -fromBytes(new Uint8Array([1, 2, 3])) -``` - -### Parameters - -None. - -### Return value - -Returns a `SecretStoreEntry`. diff --git a/documentation/versioned_docs/version-3.24.1/secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.24.1/secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.24.1/secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.24.1/secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.24.1/secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.24.1/secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.24.1/secret-store/SecretStoreEntry/prototype/rawBytes.mdx b/documentation/versioned_docs/version-3.24.1/secret-store/SecretStoreEntry/prototype/rawBytes.mdx deleted file mode 100644 index e8dd54a2c7..0000000000 --- a/documentation/versioned_docs/version-3.24.1/secret-store/SecretStoreEntry/prototype/rawBytes.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.rawBytes - -▸ **rawBytes**(): `ArrayBuffer` - -Returns the raw byte contents of the SecretStoreEntry instance as an ArrayBuffer. - -## Syntax - -```js -rawBytes() -``` - -### Parameters - -None. - -### Return value - -An ArrayBuffer - -### Exceptions - -The `rawBytes()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. diff --git a/documentation/versioned_sidebars/version-3.24.1-sidebars.json b/documentation/versioned_sidebars/version-3.24.1-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.24.1-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versions.json b/documentation/versions.json index 68fd521c76..220fcb0906 100644 --- a/documentation/versions.json +++ b/documentation/versions.json @@ -1,5 +1,4 @@ [ - "3.24.1", "3.23.0", "3.22.4", "3.21.4",