Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
import {Fiddle} from '@site/src/components/fiddle';

# setDefaultDynamicBackendConfig()

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/experimental/allowDynamicBackends.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ or

## Examples

In this example an implicit Dynamic Backend is created when making the fetch request to <https://www.fastly.com/> and the response is then returned to the client.
In this example an implicit Dynamic Backend is created when making the fetch request to https://www.fastly.com/ and the response is then returned to the client.

<Fiddle config={{
"type": "javascript",
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/globals/Boolean/Boolean.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ new Boolean(value)
Boolean(value)
```

> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value).
> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return-value).

### Parameters

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/globals/Date/Date.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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).
> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return-value).

### Parameters

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/globals/Date/parse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Date.parse(dateString)
### Parameters

- `dateString`
- : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format).
- : 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
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/globals/Date/prototype/toISOString.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ 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).
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).
2 changes: 1 addition & 1 deletion documentation/docs/globals/Function/prototype/name.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ 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.
> **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 [telling the constructor name of an object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#telling_the_constructor_name_of_an_object) for more details.

### Symbol as function name

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/globals/Function/prototype/toString.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ If the `toString()` method is called on a function created by the `Function` con
"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).
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 [browser compatibility table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/toString#browser_compatibility).
6 changes: 3 additions & 3 deletions documentation/docs/globals/JSON/stringify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ A JSON string representing the given value, or undefined.
- 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.
- 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 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.
- 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).

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/globals/Math/asin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Math.asin(x)

### Return value

The inverse sine (angle in radians between <math><semantics><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow><annotation encoding="TeX">-\frac{\pi}{2}</annotation></semantics></math> and <math><semantics><mfrac><mi>π</mi><mn>2</mn></mfrac><annotation encoding="TeX">\frac{\pi}{2}</annotation></semantics></math>, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`.
The inverse sine (angle in radians between <math><semantics><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow></semantics></math>, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`.

## Description

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/globals/Math/atan.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Math.atan(x)

### Return value

The inverse tangent (angle in radians between <math><semantics><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow><annotation encoding="TeX">-\frac{\pi}{2}</annotation></semantics></math> and <math><semantics><mfrac><mi>π</mi><mn>2</mn></mfrac><annotation encoding="TeX">\frac{\pi}{2}</annotation></semantics></math>, inclusive) of `x`. If `x` is `Infinity`, it returns <math><semantics><mfrac><mi>π</mi><mn>2</mn></mfrac><annotation encoding="TeX">\frac{\pi}{2}</annotation></semantics></math>. If `x` is `-Infinity`, it returns <math><semantics><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow><annotation encoding="TeX">-\frac{\pi}{2}</annotation></semantics></math>.
The inverse tangent (angle in radians between <math><semantics><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow></semantics></math> and <math><semantics><mfrac><mi>π</mi><mn>2</mn></mfrac></semantics></math>, inclusive) of `x`. If `x` is `Infinity`, it returns <math><semantics><mfrac><mi>π</mi><mn>2</mn></mfrac></semantics></math>. If `x` is `-Infinity`, it returns <math><semantics><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow></semantics></math>.

## Description

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/globals/Math/atan2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ The `Math.atan2()` method measures the counterclockwise angle θ, in radians, be
| `-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 <math><semantics><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow><annotation encoding="TeX">-\frac{\pi}{2}</annotation></semantics></math> or greater than <math><semantics><mfrac><mi>π</mi><mn>2</mn></mfrac><annotation encoding="TeX">\frac{\pi}{2}</annotation></semantics></math>.
In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than <math><semantics><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow></semantics></math> or greater than <math><semantics><mfrac><mi>π</mi><mn>2</mn></mfrac></semantics></math>.

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).
2 changes: 1 addition & 1 deletion documentation/docs/globals/Math/expm1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ A number representing e<sup>x</sup> - 1, where e is [the base of the natural log

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 <math display="inline"><semantics><msup><mi mathvariant="normal">e</mi><mi>x</mi></msup><annotation encoding="TeX">\mathrm{e}^x</annotation></semantics></math> where x is a number very close to 0, you should get an answer very close to 1 + x, because <math display="inline"><semantics><mrow><munder><mo lspace="0em" rspace="0em">lim</mo><mrow><mi>x</mi><mo stretchy="false">→</mo><mn>0</mn></mrow></munder><mfrac><mrow><msup><mi mathvariant="normal">e</mi><mi>x</mi></msup><mo>−</mo><mn>1</mn></mrow><mi>x</mi></mfrac><mo>=</mo><mn>1</mn></mrow><annotation encoding="TeX">\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1</annotation></semantics></math>. 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.
When you calculate <math display="inline"><semantics><msup><mi mathvariant="normal">e</mi><mi>x</mi></msup></semantics></math> where x is a number very close to 0, you should get an answer very close to 1 + x, because <math display="inline"><semantics><mrow><munder><mo lspace="0em" rspace="0em">lim</mo><mrow><mi>x</mi><mo stretchy="false">→</mo><mn>0</mn></mrow></munder><mfrac><mrow><msup><mi mathvariant="normal">e</mi><mi>x</mi></msup><mo>−</mo><mn>1</mn></mrow><mi>x</mi></mfrac><mo>=</mo><mn>1</mn></mrow></semantics></math>. 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).
2 changes: 1 addition & 1 deletion documentation/docs/globals/Math/log1p.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-I

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 <math display="inline"><semantics><mrow><munder><mo movablelimits="true" form="prefix">lim</mo><mrow ><mi>x</mi><mo stretchy="false">→</mo><mn>0</mn></mrow></munder><mfrac><mrow><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mn>1</mn><mo>+</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><mi>x</mi></mfrac><mo>=</mo><mn>1</mn></mrow><annotation encoding="TeX">\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1</annotation></semantics></math>. 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).
When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because <math display="inline"><semantics><mrow><munder><mo movablelimits="true" form="prefix">lim</mo><mrow ><mi>x</mi><mo stretchy="false">→</mo><mn>0</mn></mrow></munder><mfrac><mrow><mi>log</mi><mo>⁡</mo><mo stretchy="false">(</mo><mn>1</mn><mo>+</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><mi>x</mi></mfrac><mo>=</mo><mn>1</mn></mrow></semantics></math>. 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`.

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/globals/NaN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ There are five different types of operations that return `NaN`:

`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.)
- 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 see [silently escaping NaN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN#silently_escaping_nan) for a counter-example.)
- 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.

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/globals/Number/Number.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ new Number(value)
Number(value)
```

> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value).
> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return-value).

### Parameters

Expand Down
Loading
Loading