From c2445ce1dc3a0170e2fbfdbee10e18a7455c2282 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Mon, 11 Sep 2023 22:17:31 -0400 Subject: [PATCH] Use consistent formatting for all macros (3) (#29008) --- .../object/__lookupgetter__/index.md | 2 +- .../object/__lookupsetter__/index.md | 2 +- .../global_objects/object/create/index.md | 2 +- .../object/defineproperties/index.md | 3 +- .../global_objects/object/groupby/index.md | 2 +- .../global_objects/object/hasown/index.md | 2 +- .../object/hasownproperty/index.md | 2 +- .../reference/global_objects/object/index.md | 12 ++--- .../global_objects/object/isfrozen/index.md | 3 +- .../global_objects/object/proto/index.md | 16 +++--- .../global_objects/parsefloat/index.md | 2 +- .../global_objects/parseint/index.md | 2 +- .../global_objects/promise/any/index.md | 12 ++--- .../reference/global_objects/promise/index.md | 2 +- .../global_objects/proxy/proxy/index.md | 50 +++++++++---------- .../global_objects/regexp/@@matchall/index.md | 2 +- .../global_objects/regexp/compile/index.md | 2 +- .../global_objects/regexp/dotall/index.md | 16 +++--- .../global_objects/regexp/flags/index.md | 2 +- .../global_objects/regexp/global/index.md | 14 +++--- .../global_objects/regexp/hasindices/index.md | 18 +++---- .../global_objects/regexp/ignorecase/index.md | 14 +++--- .../reference/global_objects/regexp/index.md | 14 +++--- .../global_objects/regexp/input/index.md | 2 +- .../global_objects/regexp/lastindex/index.md | 16 +++--- .../global_objects/regexp/lastmatch/index.md | 2 +- .../global_objects/regexp/lastparen/index.md | 2 +- .../regexp/leftcontext/index.md | 2 +- .../global_objects/regexp/multiline/index.md | 14 +++--- .../global_objects/regexp/n/index.md | 2 +- .../regexp/rightcontext/index.md | 2 +- .../global_objects/regexp/sticky/index.md | 14 +++--- .../global_objects/regexp/unicode/index.md | 14 +++--- .../regexp/unicodesets/index.md | 16 +++--- .../global_objects/set/foreach/index.md | 3 +- .../sharedarraybuffer/bytelength/index.md | 2 +- .../sharedarraybuffer/index.md | 2 +- .../global_objects/string/anchor/index.md | 2 +- .../global_objects/string/at/index.md | 6 +-- .../global_objects/string/big/index.md | 2 +- .../global_objects/string/blink/index.md | 2 +- .../global_objects/string/bold/index.md | 2 +- .../string/codepointat/index.md | 2 +- .../global_objects/string/fixed/index.md | 2 +- .../global_objects/string/fontcolor/index.md | 2 +- .../global_objects/string/fontsize/index.md | 2 +- .../string/fromcharcode/index.md | 2 +- .../string/fromcodepoint/index.md | 2 +- .../reference/global_objects/string/index.md | 31 ++++++------ .../global_objects/string/italics/index.md | 2 +- .../global_objects/string/link/index.md | 2 +- .../global_objects/string/repeat/index.md | 2 +- .../global_objects/string/slice/index.md | 4 +- .../global_objects/string/small/index.md | 2 +- .../global_objects/string/strike/index.md | 2 +- .../global_objects/string/sub/index.md | 2 +- .../global_objects/string/substr/index.md | 2 +- .../global_objects/string/sup/index.md | 2 +- .../string/tolocalelowercase/index.md | 3 +- .../string/tolocaleuppercase/index.md | 3 +- .../string/tolowercase/index.md | 2 +- .../string/touppercase/index.md | 2 +- .../symbol/description/index.md | 4 +- .../global_objects/typedarray/buffer/index.md | 2 +- .../typedarray/bytelength/index.md | 2 +- .../typedarray/bytes_per_element/index.md | 2 +- .../global_objects/typedarray/fill/index.md | 2 +- .../global_objects/typedarray/from/index.md | 2 +- .../global_objects/typedarray/index.md | 2 +- .../global_objects/typedarray/length/index.md | 2 +- .../global_objects/typedarray/of/index.md | 2 +- .../typedarray/reverse/index.md | 2 +- .../global_objects/typedarray/slice/index.md | 2 +- .../global_objects/typedarray/sort/index.md | 2 +- .../typedarray/tostring/index.md | 2 +- .../reference/global_objects/weakref/index.md | 2 +- 76 files changed, 199 insertions(+), 207 deletions(-) diff --git a/files/en-us/web/javascript/reference/global_objects/object/__lookupgetter__/index.md b/files/en-us/web/javascript/reference/global_objects/object/__lookupgetter__/index.md index 87a3931db4d5b59..93d85a9868ef1f1 100644 --- a/files/en-us/web/javascript/reference/global_objects/object/__lookupgetter__/index.md +++ b/files/en-us/web/javascript/reference/global_objects/object/__lookupgetter__/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.Object.lookupGetter --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} > **Note:** This feature is deprecated in favor of the {{jsxref("Object.getOwnPropertyDescriptor()")}} API. This method's behavior is only specified for web compatibility, and is not required to be implemented in any platform. It may not work everywhere. diff --git a/files/en-us/web/javascript/reference/global_objects/object/__lookupsetter__/index.md b/files/en-us/web/javascript/reference/global_objects/object/__lookupsetter__/index.md index 1874d033985e544..9d019056d3e0599 100644 --- a/files/en-us/web/javascript/reference/global_objects/object/__lookupsetter__/index.md +++ b/files/en-us/web/javascript/reference/global_objects/object/__lookupsetter__/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.Object.lookupSetter --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} > **Note:** This feature is deprecated in favor of the {{jsxref("Object.getOwnPropertyDescriptor()")}} API. This method's behavior is only specified for web compatibility, and is not required to be implemented in any platform. It may not work everywhere. diff --git a/files/en-us/web/javascript/reference/global_objects/object/create/index.md b/files/en-us/web/javascript/reference/global_objects/object/create/index.md index c365208df81dedf..c1548455cff3347 100644 --- a/files/en-us/web/javascript/reference/global_objects/object/create/index.md +++ b/files/en-us/web/javascript/reference/global_objects/object/create/index.md @@ -22,7 +22,7 @@ Object.create(proto, propertiesObject) - `proto` - : The object which should be the prototype of the newly-created object. -- `propertiesObject` {{Optional_inline}} +- `propertiesObject` {{optional_inline}} - : If specified and not {{jsxref("undefined")}}, an object whose [enumerable own properties](/en-US/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 {{jsxref("Object.defineProperties()")}}. ### Return value diff --git a/files/en-us/web/javascript/reference/global_objects/object/defineproperties/index.md b/files/en-us/web/javascript/reference/global_objects/object/defineproperties/index.md index e1857cbf9cd922f..835b62ccb548b05 100644 --- a/files/en-us/web/javascript/reference/global_objects/object/defineproperties/index.md +++ b/files/en-us/web/javascript/reference/global_objects/object/defineproperties/index.md @@ -48,8 +48,7 @@ Object.defineProperties(obj, props) **Defaults to {{jsxref("undefined")}}.** - `writable` - : `true` if and only if the value associated with the property may be - changed with an {{jsxref("Operators#assignment_operators", "assignment operator", - "", 1)}}. + changed with an {{jsxref("Operators#assignment_operators", "assignment operator", "", 1)}}. **Defaults to `false`.** An accessor descriptor also has the following optional keys: diff --git a/files/en-us/web/javascript/reference/global_objects/object/groupby/index.md b/files/en-us/web/javascript/reference/global_objects/object/groupby/index.md index ef7c182fd82b491..ff012456200747b 100644 --- a/files/en-us/web/javascript/reference/global_objects/object/groupby/index.md +++ b/files/en-us/web/javascript/reference/global_objects/object/groupby/index.md @@ -42,7 +42,7 @@ A [`null`-prototype object](/en-US/docs/Web/JavaScript/Reference/Global_Objects/ `Object.groupBy()` calls a provided `callbackFn` function once for each element in an iterable. The callback function should return a string or symbol (values that are neither type are [coerced to strings](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion)) indicating the group of the associated element. The values returned by `callbackFn` are used as keys for the object returned by `Map.groupBy()`. Each key has an associated array containing all the elements for which the callback returned the same value. -The elements in the returned object and the original iterable are the same (not {{glossary("deep copy","deep copies")}}). Changing the internal structure of the elements will be reflected in both the original iterable and the returned object. +The elements in the returned object and the original iterable are the same (not {{Glossary("deep copy", "deep copies")}}). Changing the internal structure of the elements will be reflected in both the original iterable and the returned object. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/object/hasown/index.md b/files/en-us/web/javascript/reference/global_objects/object/hasown/index.md index 0cae5042e685885..684b0356eb48550 100644 --- a/files/en-us/web/javascript/reference/global_objects/object/hasown/index.md +++ b/files/en-us/web/javascript/reference/global_objects/object/hasown/index.md @@ -138,7 +138,7 @@ if (Object.hasOwn(foo, "bar")) { ``` It can also be used to test objects created using -{{jsxref("Object.create()","Object.create(null)")}}. These do +{{jsxref("Object.create()", "Object.create(null)")}}. These do not inherit from `Object.prototype`, and so `hasOwnProperty()` is inaccessible. ```js diff --git a/files/en-us/web/javascript/reference/global_objects/object/hasownproperty/index.md b/files/en-us/web/javascript/reference/global_objects/object/hasownproperty/index.md index 491061ecd0a8d00..630c1f27510c8e2 100644 --- a/files/en-us/web/javascript/reference/global_objects/object/hasownproperty/index.md +++ b/files/en-us/web/javascript/reference/global_objects/object/hasownproperty/index.md @@ -159,7 +159,7 @@ Note that in the first two cases there are no newly created objects. ### Objects created with Object.create(null) Objects created using -{{jsxref("Object.create()","Object.create(null)")}} do not +{{jsxref("Object.create()", "Object.create(null)")}} do not inherit from `Object.prototype`, making `hasOwnProperty()` inaccessible. ```js diff --git a/files/en-us/web/javascript/reference/global_objects/object/index.md b/files/en-us/web/javascript/reference/global_objects/object/index.md index 290f14b290271c1..ce8370008a2b2fe 100644 --- a/files/en-us/web/javascript/reference/global_objects/object/index.md +++ b/files/en-us/web/javascript/reference/global_objects/object/index.md @@ -200,7 +200,7 @@ Unlike [conversion to primitives](/en-US/docs/Web/JavaScript/Data_structures#pri - : Returns an array of all symbol properties found directly upon a given object. - {{jsxref("Object.getPrototypeOf()")}} - : Returns the prototype (internal `[[Prototype]]` property) of the specified object. -- {{jsxref("Object.groupBy()")}} {{Experimental_Inline}} +- {{jsxref("Object.groupBy()")}} {{experimental_inline}} - : Groups the elements of a given iterable according to the string values returned by a provided callback function. The returned object has separate properties for each group, containing arrays with the elements in the group. - {{jsxref("Object.hasOwn()")}} - : Returns `true` if the specified object has the indicated property as its _own_ property, or `false` if the property is inherited or does not exist. @@ -227,20 +227,20 @@ Unlike [conversion to primitives](/en-US/docs/Web/JavaScript/Data_structures#pri These properties are defined on `Object.prototype` and shared by all `Object` instances. -- [`Object.prototype.__proto__`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto) {{Deprecated_Inline}} +- [`Object.prototype.__proto__`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto) {{deprecated_inline}} - : Points to the object which was used as prototype when the object was instantiated. - {{jsxref("Object.prototype.constructor")}} - : The constructor function that created the instance object. For plain `Object` instances, the initial value is the {{jsxref("Object/Object", "Object")}} constructor. Instances of other constructors each inherit the `constructor` property from their respective `Constructor.prototype` object. ## Instance methods -- [`Object.prototype.__defineGetter__()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__) {{Deprecated_Inline}} +- [`Object.prototype.__defineGetter__()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__) {{deprecated_inline}} - : Associates a function with a property that, when accessed, executes that function and returns its return value. -- [`Object.prototype.__defineSetter__()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineSetter__) {{Deprecated_Inline}} +- [`Object.prototype.__defineSetter__()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineSetter__) {{deprecated_inline}} - : Associates a function with a property that, when set, executes that function which modifies the property. -- [`Object.prototype.__lookupGetter__()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupGetter__) {{Deprecated_Inline}} +- [`Object.prototype.__lookupGetter__()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupGetter__) {{deprecated_inline}} - : Returns the function bound as a getter to the specified property. -- [`Object.prototype.__lookupSetter__()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupSetter__) {{Deprecated_Inline}} +- [`Object.prototype.__lookupSetter__()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupSetter__) {{deprecated_inline}} - : Returns the function bound as a setter to the specified property. - {{jsxref("Object.prototype.hasOwnProperty()")}} - : Returns a boolean indicating whether an object contains the specified property as a direct property of that object and not inherited through the prototype chain. diff --git a/files/en-us/web/javascript/reference/global_objects/object/isfrozen/index.md b/files/en-us/web/javascript/reference/global_objects/object/isfrozen/index.md index 0698d24a8a054b4..1049394ddad55bd 100644 --- a/files/en-us/web/javascript/reference/global_objects/object/isfrozen/index.md +++ b/files/en-us/web/javascript/reference/global_objects/object/isfrozen/index.md @@ -29,8 +29,7 @@ A {{jsxref("Boolean")}} indicating whether or not the given object is frozen. ## Description -An object is frozen if and only if it is not {{jsxref("Object.isExtensible()", - "extensible", "", 1)}}, all its properties are non-configurable, and all its data +An object is frozen if and only if it is not [extensible](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), 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/files/en-us/web/javascript/reference/global_objects/object/proto/index.md b/files/en-us/web/javascript/reference/global_objects/object/proto/index.md index c0a69ebc4a80542..e43a5528ed231e3 100644 --- a/files/en-us/web/javascript/reference/global_objects/object/proto/index.md +++ b/files/en-us/web/javascript/reference/global_objects/object/proto/index.md @@ -7,15 +7,15 @@ status: browser-compat: javascript.builtins.Object.proto --- -{{JSRef}}{{Deprecated_header}} +{{JSRef}}{{Deprecated_Header}} > **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 `obj.__proto__ = ...` 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). -> **Note:** The use of `__proto__` is controversial and discouraged. Its existence and exact behavior have only been standardized as a legacy feature to ensure web compatibility, while it presents several security issues and footguns. For better support, prefer {{JSxRef("Object.getPrototypeOf()")}}/{{JSxRef("Reflect.getPrototypeOf()")}} and {{JSxRef("Object.setPrototypeOf()")}}/{{JSxRef("Reflect.setPrototypeOf()")}} instead. +> **Note:** The use of `__proto__` is controversial and discouraged. Its existence and exact behavior have only been standardized as a legacy feature to ensure web compatibility, while it presents several security issues and footguns. For better support, prefer {{jsxref("Object.getPrototypeOf()")}}/{{jsxref("Reflect.getPrototypeOf()")}} and {{jsxref("Object.setPrototypeOf()")}}/{{jsxref("Reflect.setPrototypeOf()")}} instead. The **`__proto__`** accessor property of {{jsxref("Object")}} instances exposes the [`[[Prototype]]`](/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) (either an object or {{jsxref("Operators/null", "null")}}) of this object. -The `__proto__` property can also be used in an object literal definition to set the object `[[Prototype]]` on creation, as an alternative to {{JSxRef("Object.create()")}}. See: [object initializer / literal syntax](/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer). That syntax is standard and optimized for in implementations, and quite different from `Object.prototype.__proto__`. +The `__proto__` property can also be used in an object literal definition to set the object `[[Prototype]]` on creation, as an alternative to {{jsxref("Object.create()")}}. See: [object initializer / literal syntax](/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer). That syntax is standard and optimized for in implementations, and quite different from `Object.prototype.__proto__`. ## Syntax @@ -34,9 +34,9 @@ If used as a getter, returns the object's `[[Prototype]]`. ## Description -The `__proto__` getter function exposes the value of the internal `[[Prototype]]` of an object. For objects created using an object literal, this value is `Object.prototype`. For objects created using array literals, this value is [`Array.prototype`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array). For functions, this value is {{JSxRef("Function.prototype")}}. You can read more about the prototype chain in [Inheritance and the prototype chain](/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain). +The `__proto__` getter function exposes the value of the internal `[[Prototype]]` of an object. For objects created using an object literal, this value is `Object.prototype`. For objects created using array literals, this value is [`Array.prototype`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array). For functions, this value is {{jsxref("Function.prototype")}}. You can read more about the prototype chain in [Inheritance and the prototype chain](/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain). -The `__proto__` setter allows the `[[Prototype]]` of an object to be mutated. The value provided must be an object or {{JSxRef("Operators/null", "null")}}. Providing any other value will do nothing. +The `__proto__` setter allows the `[[Prototype]]` of an object to be mutated. The value provided must be an object or {{jsxref("Operators/null", "null")}}. Providing any other value will do nothing. Unlike {{jsxref("Object.getPrototypeOf()")}} and {{jsxref("Object.setPrototypeOf()")}}, which are always available on `Object` as static properties and always reflect the `[[Prototype]]` internal property, the `__proto__` property doesn't always exist as a property on all objects, and as a result doesn't reflect `[[Prototype]]` reliably. @@ -116,6 +116,6 @@ obj.myName(); // myName ## See also -- {{JSxRef("Object.prototype.isPrototypeOf()")}} -- {{JSxRef("Object.getPrototypeOf()")}} -- {{JSxRef("Object.setPrototypeOf()")}} +- {{jsxref("Object.prototype.isPrototypeOf()")}} +- {{jsxref("Object.getPrototypeOf()")}} +- {{jsxref("Object.setPrototypeOf()")}} diff --git a/files/en-us/web/javascript/reference/global_objects/parsefloat/index.md b/files/en-us/web/javascript/reference/global_objects/parsefloat/index.md index 398b4e7d053c279..10d647563d40260 100644 --- a/files/en-us/web/javascript/reference/global_objects/parsefloat/index.md +++ b/files/en-us/web/javascript/reference/global_objects/parsefloat/index.md @@ -20,7 +20,7 @@ parseFloat(string) ### Parameters - `string` - - : The value to parse, [coerced to a string](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading {{glossary("whitespace")}} in this argument is ignored. + - : The value to parse, [coerced to a string](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading {{Glossary("whitespace")}} in this argument is ignored. ### Return value diff --git a/files/en-us/web/javascript/reference/global_objects/parseint/index.md b/files/en-us/web/javascript/reference/global_objects/parseint/index.md index fd21263f62b7cfe..362475a2d1e1af7 100644 --- a/files/en-us/web/javascript/reference/global_objects/parseint/index.md +++ b/files/en-us/web/javascript/reference/global_objects/parseint/index.md @@ -21,7 +21,7 @@ parseInt(string, radix) ### Parameters - `string` - - : A string starting with an integer. Leading {{glossary("whitespace")}} in this argument is ignored. + - : A string starting with an integer. Leading {{Glossary("whitespace")}} in this argument is ignored. - `radix` {{optional_inline}} - : 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](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's nonzero and 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. diff --git a/files/en-us/web/javascript/reference/global_objects/promise/any/index.md b/files/en-us/web/javascript/reference/global_objects/promise/any/index.md index 58ddbbb1dda9785..136f796a95b0c44 100644 --- a/files/en-us/web/javascript/reference/global_objects/promise/any/index.md +++ b/files/en-us/web/javascript/reference/global_objects/promise/any/index.md @@ -34,9 +34,9 @@ A {{jsxref("Promise")}} that is: The `Promise.any()` method is one of the [promise concurrency](/en-US/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 {{JSxRef("Promise.all()")}}, 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 {{jsxref("Array.prototype.some()")}} and {{jsxref("Array.prototype.every()")}}. +Unlike {{jsxref("Promise.all()")}}, 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 {{jsxref("Array.prototype.some()")}} and {{jsxref("Array.prototype.every()")}}. -Also, unlike {{JSxRef("Promise.race()")}}, 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. +Also, unlike {{jsxref("Promise.race()")}}, 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. ## Examples @@ -121,7 +121,7 @@ Promise.any([coffee, tea]) ## See also - [Polyfill of `Promise.any` in `core-js`](https://github.com/zloirock/core-js#ecmascript-promise) -- {{JSxRef("Promise")}} -- {{JSxRef("Promise.all()")}} -- {{JSxRef("Promise.allSettled()")}} -- {{JSxRef("Promise.race()")}} +- {{jsxref("Promise")}} +- {{jsxref("Promise.all()")}} +- {{jsxref("Promise.allSettled()")}} +- {{jsxref("Promise.race()")}} diff --git a/files/en-us/web/javascript/reference/global_objects/promise/index.md b/files/en-us/web/javascript/reference/global_objects/promise/index.md index cd48d12b1007e3f..3326b1e31cb6bf8 100644 --- a/files/en-us/web/javascript/reference/global_objects/promise/index.md +++ b/files/en-us/web/javascript/reference/global_objects/promise/index.md @@ -305,7 +305,7 @@ new Promise(tetheredGetNumber) This small example shows the mechanism of a `Promise`. The `testPromise()` method is called each time the {{HTMLElement("button")}} is clicked. It creates a promise that will be fulfilled, using {{domxref("setTimeout()")}}, to the promise count (number starting from 1) every 1-3 seconds, at random. The `Promise()` constructor is used to create the promise. -The fulfillment of the promise is logged, via a fulfill callback set using {{jsxref("Promise.prototype.then()","p1.then()")}}. A few logs show how the synchronous part of the method is decoupled from the asynchronous completion of the promise. +The fulfillment of the promise is logged, via a fulfill callback set using {{jsxref("Promise.prototype.then()", "p1.then()")}}. A few logs show how the synchronous part of the method is decoupled from the asynchronous completion of the promise. By clicking the button several times in a short amount of time, you'll even see the different promises being fulfilled one after another. diff --git a/files/en-us/web/javascript/reference/global_objects/proxy/proxy/index.md b/files/en-us/web/javascript/reference/global_objects/proxy/proxy/index.md index 74695f54dde634b..251157e54370120 100644 --- a/files/en-us/web/javascript/reference/global_objects/proxy/proxy/index.md +++ b/files/en-us/web/javascript/reference/global_objects/proxy/proxy/index.md @@ -46,35 +46,33 @@ This section lists all the handler functions you can define. Handler functions a sometimes called _traps_, because they trap calls to the underlying target object. -- {{JSxRef("Global_Objects/Proxy/Proxy/apply", "handler.apply()")}} +- {{jsxref("Proxy/Proxy/apply", "handler.apply()")}} - : A trap for a function call. -- {{JSxRef("Global_Objects/Proxy/Proxy/construct", "handler.construct()")}} - - : A trap for the {{JSxRef("Operators/new", "new")}} operator. -- {{JSxRef("Global_Objects/Proxy/Proxy/defineProperty", "handler.defineProperty()")}} - - : A trap for {{JSxRef("Object.defineProperty")}}. -- {{JSxRef("Global_Objects/Proxy/Proxy/deleteProperty", "handler.deleteProperty()")}} - - : A trap for the {{JSxRef("Operators/delete", "delete")}} operator. -- {{JSxRef("Global_Objects/Proxy/Proxy/get", "handler.get()")}} +- {{jsxref("Proxy/Proxy/construct", "handler.construct()")}} + - : A trap for the {{jsxref("Operators/new", "new")}} operator. +- {{jsxref("Proxy/Proxy/defineProperty", "handler.defineProperty()")}} + - : A trap for {{jsxref("Object.defineProperty")}}. +- {{jsxref("Proxy/Proxy/deleteProperty", "handler.deleteProperty()")}} + - : A trap for the {{jsxref("Operators/delete", "delete")}} operator. +- {{jsxref("Proxy/Proxy/get", "handler.get()")}} - : A trap for getting property values. -- {{JSxRef("Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor", - "handler.getOwnPropertyDescriptor()")}} - - : A trap for {{JSxRef("Object.getOwnPropertyDescriptor")}}. -- {{JSxRef("Global_Objects/Proxy/Proxy/getPrototypeOf", "handler.getPrototypeOf()")}} - - : A trap for {{JSxRef("Object.getPrototypeOf")}}. -- {{JSxRef("Global_Objects/Proxy/Proxy/has", "handler.has()")}} - - : A trap for the {{JSxRef("Operators/in", "in")}} operator. -- {{JSxRef("Global_Objects/Proxy/Proxy/isExtensible", "handler.isExtensible()")}} - - : A trap for {{JSxRef("Object.isExtensible")}}. -- {{JSxRef("Global_Objects/Proxy/Proxy/ownKeys", "handler.ownKeys()")}} - - : A trap for {{JSxRef("Object.getOwnPropertyNames")}} and - {{JSxRef("Object.getOwnPropertySymbols")}}. -- {{JSxRef("Global_Objects/Proxy/Proxy/preventExtensions", - "handler.preventExtensions()")}} - - : A trap for {{JSxRef("Object.preventExtensions")}}. -- {{JSxRef("Global_Objects/Proxy/Proxy/set", "handler.set()")}} +- {{jsxref("Proxy/Proxy/getOwnPropertyDescriptor", "handler.getOwnPropertyDescriptor()")}} + - : A trap for {{jsxref("Object.getOwnPropertyDescriptor")}}. +- {{jsxref("Proxy/Proxy/getPrototypeOf", "handler.getPrototypeOf()")}} + - : A trap for {{jsxref("Object.getPrototypeOf")}}. +- {{jsxref("Proxy/Proxy/has", "handler.has()")}} + - : A trap for the {{jsxref("Operators/in", "in")}} operator. +- {{jsxref("Proxy/Proxy/isExtensible", "handler.isExtensible()")}} + - : A trap for {{jsxref("Object.isExtensible")}}. +- {{jsxref("Proxy/Proxy/ownKeys", "handler.ownKeys()")}} + - : A trap for {{jsxref("Object.getOwnPropertyNames")}} and + {{jsxref("Object.getOwnPropertySymbols")}}. +- {{jsxref("Proxy/Proxy/preventExtensions", "handler.preventExtensions()")}} + - : A trap for {{jsxref("Object.preventExtensions")}}. +- {{jsxref("Proxy/Proxy/set", "handler.set()")}} - : A trap for setting property values. -- {{JSxRef("Global_Objects/Proxy/Proxy/setPrototypeOf", "handler.setPrototypeOf()")}} - - : A trap for {{JSxRef("Object.setPrototypeOf")}}. +- {{jsxref("Proxy/Proxy/setPrototypeOf", "handler.setPrototypeOf()")}} + - : A trap for {{jsxref("Object.setPrototypeOf")}}. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/@@matchall/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/@@matchall/index.md index 9de10fb7ccdf791..710a87a1cc12f12 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/@@matchall/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/@@matchall/index.md @@ -65,7 +65,7 @@ console.log(Array.from("😄".matchAll(/(?:)/gu))); // [ [ "" ], [ "" ] ] ``` -This method exists for customizing the behavior of `matchAll()` in {{jsxref('RegExp')}} subclasses. +This method exists for customizing the behavior of `matchAll()` in {{jsxref("RegExp")}} subclasses. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/compile/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/compile/index.md index 0f504f0e1d7c578..9acdb6a048c5050 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/compile/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/compile/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.RegExp.compile --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} > **Note:** The `compile()` method is only specified for compatibility reasons. Using `compile()` causes the otherwise immutable regex source and flags to become mutable, which may break user expectations. You can use the [`RegExp()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor to construct a new regular expression object instead. diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/dotall/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/dotall/index.md index 842161ede71b0b6..2abdd81b7e2ed2c 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/dotall/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/dotall/index.md @@ -59,11 +59,11 @@ console.log(str2.replace(regex2, "")); ## See also - [Polyfill of the `dotAll` flag in `core-js`](https://github.com/zloirock/core-js#ecmascript-string-and-regexp) -- {{JSxRef("RegExp.prototype.lastIndex")}} -- {{JSxRef("RegExp.prototype.global")}} -- {{JSxRef("RegExp.prototype.hasIndices")}} -- {{JSxRef("RegExp.prototype.ignoreCase")}} -- {{JSxRef("RegExp.prototype.multiline")}} -- {{JSxRef("RegExp.prototype.source")}} -- {{JSxRef("RegExp.prototype.sticky")}} -- {{JSxRef("RegExp.prototype.unicode")}} +- {{jsxref("RegExp.prototype.lastIndex")}} +- {{jsxref("RegExp.prototype.global")}} +- {{jsxref("RegExp.prototype.hasIndices")}} +- {{jsxref("RegExp.prototype.ignoreCase")}} +- {{jsxref("RegExp.prototype.multiline")}} +- {{jsxref("RegExp.prototype.source")}} +- {{jsxref("RegExp.prototype.sticky")}} +- {{jsxref("RegExp.prototype.unicode")}} diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/flags/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/flags/index.md index 73b818793b74cbd..ec5ef5d0bc8c8a8 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/flags/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/flags/index.md @@ -39,4 +39,4 @@ The set accessor of `flags` is `undefined`. You cannot change this property dire ## See also - [Polyfill of `RegExp.prototype.flags` in `core-js`](https://github.com/zloirock/core-js#ecmascript-string-and-regexp) -- {{JSxRef("RegExp.prototype.source")}} +- {{jsxref("RegExp.prototype.source")}} diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/global/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/global/index.md index 1dfb1d6de1477e8..ee531bcb1da0e48 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/global/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/global/index.md @@ -47,10 +47,10 @@ console.log(str2); // examplefoo ## See also - {{jsxref("RegExp.prototype.lastIndex")}} -- {{JSxRef("RegExp.prototype.dotAll")}} -- {{JSxRef("RegExp.prototype.hasIndices")}} -- {{JSxRef("RegExp.prototype.ignoreCase")}} -- {{JSxRef("RegExp.prototype.multiline")}} -- {{JSxRef("RegExp.prototype.source")}} -- {{JSxRef("RegExp.prototype.sticky")}} -- {{JSxRef("RegExp.prototype.unicode")}} +- {{jsxref("RegExp.prototype.dotAll")}} +- {{jsxref("RegExp.prototype.hasIndices")}} +- {{jsxref("RegExp.prototype.ignoreCase")}} +- {{jsxref("RegExp.prototype.multiline")}} +- {{jsxref("RegExp.prototype.source")}} +- {{jsxref("RegExp.prototype.sticky")}} +- {{jsxref("RegExp.prototype.unicode")}} diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/hasindices/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/hasindices/index.md index 67c54e524522c78..bda6ceb0d95ff3f 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/hasindices/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/hasindices/index.md @@ -54,12 +54,12 @@ console.log(regex2.exec(str2).indices); // undefined ## See also -- {{JSxRef("RegExp.prototype.lastIndex")}} -- {{JSxRef("RegExp.prototype.exec()")}} -- {{JSxRef("RegExp.prototype.dotAll")}} -- {{JSxRef("RegExp.prototype.global")}} -- {{JSxRef("RegExp.prototype.ignoreCase")}} -- {{JSxRef("RegExp.prototype.multiline")}} -- {{JSxRef("RegExp.prototype.source")}} -- {{JSxRef("RegExp.prototype.sticky")}} -- {{JSxRef("RegExp.prototype.unicode")}} +- {{jsxref("RegExp.prototype.lastIndex")}} +- {{jsxref("RegExp.prototype.exec()")}} +- {{jsxref("RegExp.prototype.dotAll")}} +- {{jsxref("RegExp.prototype.global")}} +- {{jsxref("RegExp.prototype.ignoreCase")}} +- {{jsxref("RegExp.prototype.multiline")}} +- {{jsxref("RegExp.prototype.source")}} +- {{jsxref("RegExp.prototype.sticky")}} +- {{jsxref("RegExp.prototype.unicode")}} diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/ignorecase/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/ignorecase/index.md index 7639c812b3c756b..b94a50c27b5b2fc 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/ignorecase/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/ignorecase/index.md @@ -42,10 +42,10 @@ console.log(regex.ignoreCase); // true ## See also - {{jsxref("RegExp.prototype.lastIndex")}} -- {{JSxRef("RegExp.prototype.dotAll")}} -- {{JSxRef("RegExp.prototype.global")}} -- {{JSxRef("RegExp.prototype.hasIndices")}} -- {{JSxRef("RegExp.prototype.multiline")}} -- {{JSxRef("RegExp.prototype.source")}} -- {{JSxRef("RegExp.prototype.sticky")}} -- {{JSxRef("RegExp.prototype.unicode")}} +- {{jsxref("RegExp.prototype.dotAll")}} +- {{jsxref("RegExp.prototype.global")}} +- {{jsxref("RegExp.prototype.hasIndices")}} +- {{jsxref("RegExp.prototype.multiline")}} +- {{jsxref("RegExp.prototype.source")}} +- {{jsxref("RegExp.prototype.sticky")}} +- {{jsxref("RegExp.prototype.unicode")}} diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/index.md index cde5ae851af5233..f885d120413b54c 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/index.md @@ -99,17 +99,17 @@ Note that several of the {{jsxref("RegExp")}} properties have both long and shor ## Static properties -- {{jsxref("RegExp/n", "RegExp.$1, …, RegExp.$9")}} {{Deprecated_Inline}} +- {{jsxref("RegExp/n", "RegExp.$1, …, RegExp.$9")}} {{deprecated_inline}} - : Static read-only properties that contain parenthesized substring matches. -- {{jsxref("RegExp.input", "RegExp.input ($_)")}} {{Deprecated_Inline}} +- {{jsxref("RegExp.input", "RegExp.input ($_)")}} {{deprecated_inline}} - : A static property that contains the last string against which a regular expression was successfully matched. -- {{jsxref("RegExp.lastMatch", "RegExp.lastMatch ($&)")}} {{Deprecated_Inline}} +- {{jsxref("RegExp.lastMatch", "RegExp.lastMatch ($&)")}} {{deprecated_inline}} - : A static read-only property that contains the last matched substring. -- {{jsxref("RegExp.lastParen", "RegExp.lastParen ($+)")}} {{Deprecated_Inline}} +- {{jsxref("RegExp.lastParen", "RegExp.lastParen ($+)")}} {{deprecated_inline}} - : A static read-only property that contains the last parenthesized substring match. -- {{jsxref("RegExp.leftContext", "RegExp.leftContext ($`)")}} {{Deprecated_Inline}} +- {{jsxref("RegExp.leftContext", "RegExp.leftContext ($`)")}} {{deprecated_inline}} - : A static read-only property that contains the substring preceding the most recent match. -- {{jsxref("RegExp.rightContext", "RegExp.rightContext ($')")}} {{Deprecated_Inline}} +- {{jsxref("RegExp.rightContext", "RegExp.rightContext ($')")}} {{deprecated_inline}} - : A static read-only property that contains the substring following the most recent match. - {{jsxref("RegExp/@@species", "RegExp[@@species]")}} - : The constructor function that is used to create derived objects. @@ -148,7 +148,7 @@ These properties are own properties of each `RegExp` instance. ## Instance methods -- {{jsxref("RegExp.prototype.compile()")}} {{Deprecated_Inline}} +- {{jsxref("RegExp.prototype.compile()")}} {{deprecated_inline}} - : (Re-)compiles a regular expression during execution of a script. - {{jsxref("RegExp.prototype.exec()")}} - : Executes a search for a match in its string parameter. diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/input/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/input/index.md index 94bea66427b04f5..9f36455c896f3b7 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/input/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/input/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.RegExp.input --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} > **Note:** All `RegExp` static properties that expose the last match state globally are deprecated. See [deprecated RegExp features](/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#regexp) for more information. diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/lastindex/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/lastindex/index.md index 0ee20baf83e816f..c10a92fa0007c2d 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/lastindex/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/lastindex/index.md @@ -183,11 +183,11 @@ console.log(matchFoo("foo baz", 0)[0]); // "foo" ## See also -- {{JSxRef("RegExp.prototype.dotAll")}} -- {{JSxRef("RegExp.prototype.global")}} -- {{JSxRef("RegExp.prototype.hasIndices")}} -- {{JSxRef("RegExp.prototype.ignoreCase")}} -- {{JSxRef("RegExp.prototype.multiline")}} -- {{JSxRef("RegExp.prototype.source")}} -- {{JSxRef("RegExp.prototype.sticky")}} -- {{JSxRef("RegExp.prototype.unicode")}} +- {{jsxref("RegExp.prototype.dotAll")}} +- {{jsxref("RegExp.prototype.global")}} +- {{jsxref("RegExp.prototype.hasIndices")}} +- {{jsxref("RegExp.prototype.ignoreCase")}} +- {{jsxref("RegExp.prototype.multiline")}} +- {{jsxref("RegExp.prototype.source")}} +- {{jsxref("RegExp.prototype.sticky")}} +- {{jsxref("RegExp.prototype.unicode")}} diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/lastmatch/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/lastmatch/index.md index d9d82d9cb3a0828..da11be76c830589 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/lastmatch/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/lastmatch/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.RegExp.lastMatch --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} > **Note:** All `RegExp` static properties that expose the last match state globally are deprecated. See [deprecated RegExp features](/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#regexp) for more information. diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/lastparen/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/lastparen/index.md index 06c86955a80de92..76f0bedf1c6ddcc 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/lastparen/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/lastparen/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.RegExp.lastParen --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} > **Note:** All `RegExp` static properties that expose the last match state globally are deprecated. See [deprecated RegExp features](/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#regexp) for more information. diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/leftcontext/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/leftcontext/index.md index fca63be2fc78534..a964ca52ab15ad5 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/leftcontext/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/leftcontext/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.RegExp.leftContext --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} > **Note:** All `RegExp` static properties that expose the last match state globally are deprecated. See [deprecated RegExp features](/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#regexp) for more information. diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/multiline/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/multiline/index.md index 6a7c62d817e2515..1e5254a5731e4d6 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/multiline/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/multiline/index.md @@ -38,10 +38,10 @@ console.log(regex.multiline); // true ## See also - {{jsxref("RegExp.prototype.lastIndex")}} -- {{JSxRef("RegExp.prototype.dotAll")}} -- {{JSxRef("RegExp.prototype.global")}} -- {{JSxRef("RegExp.prototype.hasIndices")}} -- {{JSxRef("RegExp.prototype.ignoreCase")}} -- {{JSxRef("RegExp.prototype.source")}} -- {{JSxRef("RegExp.prototype.sticky")}} -- {{JSxRef("RegExp.prototype.unicode")}} +- {{jsxref("RegExp.prototype.dotAll")}} +- {{jsxref("RegExp.prototype.global")}} +- {{jsxref("RegExp.prototype.hasIndices")}} +- {{jsxref("RegExp.prototype.ignoreCase")}} +- {{jsxref("RegExp.prototype.source")}} +- {{jsxref("RegExp.prototype.sticky")}} +- {{jsxref("RegExp.prototype.unicode")}} diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/n/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/n/index.md index 7431f6adec92322..4e72351876372e3 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/n/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/n/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.RegExp.n --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} > **Note:** All `RegExp` static properties that expose the last match state globally are deprecated. See [deprecated RegExp features](/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#regexp) for more information. diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/rightcontext/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/rightcontext/index.md index 195727dd732857d..d61afcdeb61a1cf 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/rightcontext/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/rightcontext/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.RegExp.rightContext --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} > **Note:** All `RegExp` static properties that expose the last match state globally are deprecated. See [deprecated RegExp features](/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features#regexp) for more information. diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/sticky/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/sticky/index.md index 9c354b0943b7a57..ef427918cf9e9af 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/sticky/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/sticky/index.md @@ -94,10 +94,10 @@ regex2.test(".\nfoo"); // true - index 2 is the beginning of a line - [Polyfill of the `sticky` flag in `core-js`](https://github.com/zloirock/core-js#ecmascript-string-and-regexp) - {{jsxref("RegExp.prototype.lastIndex")}} -- {{JSxRef("RegExp.prototype.dotAll")}} -- {{JSxRef("RegExp.prototype.global")}} -- {{JSxRef("RegExp.prototype.hasIndices")}} -- {{JSxRef("RegExp.prototype.ignoreCase")}} -- {{JSxRef("RegExp.prototype.multiline")}} -- {{JSxRef("RegExp.prototype.source")}} -- {{JSxRef("RegExp.prototype.unicode")}} +- {{jsxref("RegExp.prototype.dotAll")}} +- {{jsxref("RegExp.prototype.global")}} +- {{jsxref("RegExp.prototype.hasIndices")}} +- {{jsxref("RegExp.prototype.ignoreCase")}} +- {{jsxref("RegExp.prototype.multiline")}} +- {{jsxref("RegExp.prototype.source")}} +- {{jsxref("RegExp.prototype.unicode")}} diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/unicode/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/unicode/index.md index 7b2a84c5fec4a94..04b465067a00f4f 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/unicode/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/unicode/index.md @@ -50,10 +50,10 @@ console.log(regex.unicode); // true ## See also - {{jsxref("RegExp.prototype.lastIndex")}} -- {{JSxRef("RegExp.prototype.dotAll")}} -- {{JSxRef("RegExp.prototype.global")}} -- {{JSxRef("RegExp.prototype.hasIndices")}} -- {{JSxRef("RegExp.prototype.ignoreCase")}} -- {{JSxRef("RegExp.prototype.multiline")}} -- {{JSxRef("RegExp.prototype.source")}} -- {{JSxRef("RegExp.prototype.sticky")}} +- {{jsxref("RegExp.prototype.dotAll")}} +- {{jsxref("RegExp.prototype.global")}} +- {{jsxref("RegExp.prototype.hasIndices")}} +- {{jsxref("RegExp.prototype.ignoreCase")}} +- {{jsxref("RegExp.prototype.multiline")}} +- {{jsxref("RegExp.prototype.source")}} +- {{jsxref("RegExp.prototype.sticky")}} diff --git a/files/en-us/web/javascript/reference/global_objects/regexp/unicodesets/index.md b/files/en-us/web/javascript/reference/global_objects/regexp/unicodesets/index.md index afb1b3444aa0740..f5f3cdac17c1ea4 100644 --- a/files/en-us/web/javascript/reference/global_objects/regexp/unicodesets/index.md +++ b/files/en-us/web/javascript/reference/global_objects/regexp/unicodesets/index.md @@ -44,12 +44,12 @@ console.log(regex.unicodeSets); // true ## See also - {{jsxref("RegExp.prototype.lastIndex")}} -- {{JSxRef("RegExp.prototype.dotAll")}} -- {{JSxRef("RegExp.prototype.global")}} -- {{JSxRef("RegExp.prototype.hasIndices")}} -- {{JSxRef("RegExp.prototype.ignoreCase")}} -- {{JSxRef("RegExp.prototype.multiline")}} -- {{JSxRef("RegExp.prototype.source")}} -- {{JSxRef("RegExp.prototype.sticky")}} -- {{JSxRef("RegExp.prototype.unicode")}} +- {{jsxref("RegExp.prototype.dotAll")}} +- {{jsxref("RegExp.prototype.global")}} +- {{jsxref("RegExp.prototype.hasIndices")}} +- {{jsxref("RegExp.prototype.ignoreCase")}} +- {{jsxref("RegExp.prototype.multiline")}} +- {{jsxref("RegExp.prototype.source")}} +- {{jsxref("RegExp.prototype.sticky")}} +- {{jsxref("RegExp.prototype.unicode")}} - [RegExp v flag with set notation and properties of strings](https://v8.dev/features/regexp-v-flag) on v8.dev (2022) diff --git a/files/en-us/web/javascript/reference/global_objects/set/foreach/index.md b/files/en-us/web/javascript/reference/global_objects/set/foreach/index.md index 95a39eb366c98a2..bf7afb5923c349b 100644 --- a/files/en-us/web/javascript/reference/global_objects/set/foreach/index.md +++ b/files/en-us/web/javascript/reference/global_objects/set/foreach/index.md @@ -51,8 +51,7 @@ it is executed for values which are present but have the value `undefined`. There are no keys in `Set` objects, however, so the first two arguments are both **values** contained in the {{jsxref("Set")}}. This is to make it -consistent with other `forEach()` methods for {{jsxref("Map/foreach", - "Map")}} and {{jsxref("Array/forEach","Array")}}. +consistent with other `forEach()` methods for {{jsxref("Map/foreach", "Map")}} and {{jsxref("Array/forEach", "Array")}}. If a `thisArg` parameter is provided to `forEach()`, it will be passed to `callback` when invoked, for use as its diff --git a/files/en-us/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md b/files/en-us/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md index 307a432e51d173a..1081f75d21956a6 100644 --- a/files/en-us/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md +++ b/files/en-us/web/javascript/reference/global_objects/sharedarraybuffer/bytelength/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.SharedArrayBuffer.byteLength The **`byteLength`** accessor property of {{jsxref("SharedArrayBuffer")}} instances returns the length (in bytes) of this `SharedArrayBuffer`. -{{EmbedInteractiveExample("pages/js/sharedarraybuffer-bytelength.html","shorter")}} +{{EmbedInteractiveExample("pages/js/sharedarraybuffer-bytelength.html", "shorter")}} ## Description diff --git a/files/en-us/web/javascript/reference/global_objects/sharedarraybuffer/sharedarraybuffer/index.md b/files/en-us/web/javascript/reference/global_objects/sharedarraybuffer/sharedarraybuffer/index.md index 94fafb914408f30..56b2a7a4aa83e68 100644 --- a/files/en-us/web/javascript/reference/global_objects/sharedarraybuffer/sharedarraybuffer/index.md +++ b/files/en-us/web/javascript/reference/global_objects/sharedarraybuffer/sharedarraybuffer/index.md @@ -11,7 +11,7 @@ browser-compat: javascript.builtins.SharedArrayBuffer.SharedArrayBuffer The **`SharedArrayBuffer()`** constructor creates {{jsxref("SharedArrayBuffer")}} objects. -{{EmbedInteractiveExample("pages/js/sharedarraybuffer-constructor.html","shorter")}} +{{EmbedInteractiveExample("pages/js/sharedarraybuffer-constructor.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/string/anchor/index.md b/files/en-us/web/javascript/reference/global_objects/string/anchor/index.md index 051916d1007468d..8f5d164f2320f82 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/anchor/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/anchor/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.anchor --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`anchor()`** method of {{jsxref("String")}} values creates a string that embeds this string in an {{HTMLElement("a")}} element with a name (`str`). diff --git a/files/en-us/web/javascript/reference/global_objects/string/at/index.md b/files/en-us/web/javascript/reference/global_objects/string/at/index.md index e1495bbaf5aecc0..456b13d325f81ed 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/at/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/at/index.md @@ -7,7 +7,7 @@ browser-compat: javascript.builtins.String.at {{JSRef}} -The **`at()`** method of {{jsxref("String")}} values takes an integer value and returns a new {{jsxref('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. +The **`at()`** method of {{jsxref("String")}} values takes an integer value and returns a new {{jsxref("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. {{EmbedInteractiveExample("pages/js/string-at.html")}} @@ -24,7 +24,7 @@ at(index) ### Return value -A {{jsxref('String')}} consisting of the single UTF-16 code unit located at the specified position. Returns {{jsxref('undefined')}} if the given index can not be found. +A {{jsxref("String")}} consisting of the single UTF-16 code unit located at the specified position. Returns {{jsxref("undefined")}} if the given index can not be found. ## Examples @@ -49,7 +49,7 @@ console.log(returnLast(invoiceRef)); // '2' ### Comparing methods -Here we compare different ways to select the penultimate (last but one) character of a {{jsxref('String')}}. Whilst all below methods are valid, it highlights the succinctness and readability of the `at()` method. +Here we compare different ways to select the penultimate (last but one) character of a {{jsxref("String")}}. Whilst all below methods are valid, it highlights the succinctness and readability of the `at()` method. ```js const myString = "Every green bus drives fast."; diff --git a/files/en-us/web/javascript/reference/global_objects/string/big/index.md b/files/en-us/web/javascript/reference/global_objects/string/big/index.md index aa520c1813d104f..1df26cffe2dbc23 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/big/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/big/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.big --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`big()`** method of {{jsxref("String")}} values creates a string that embeds this string in a {{HTMLElement("big")}} element (`str`), which causes this string to be displayed in a big font. diff --git a/files/en-us/web/javascript/reference/global_objects/string/blink/index.md b/files/en-us/web/javascript/reference/global_objects/string/blink/index.md index 5c4854c8e6e65ad..cc6fba9a4603f1c 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/blink/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/blink/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.blink --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`blink()`** method of {{jsxref("String")}} values creates a string that embeds this string in a (`str`), which used to cause a string to blink in old browsers. diff --git a/files/en-us/web/javascript/reference/global_objects/string/bold/index.md b/files/en-us/web/javascript/reference/global_objects/string/bold/index.md index dfe5d2c875b58f4..24a5bbefeb6bdd2 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/bold/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/bold/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.bold --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`bold()`** method of {{jsxref("String")}} values creates a string that embeds this string in a {{HTMLElement("b")}} element (`str`), which causes this string to be displayed as bold. diff --git a/files/en-us/web/javascript/reference/global_objects/string/codepointat/index.md b/files/en-us/web/javascript/reference/global_objects/string/codepointat/index.md index 528bf6eeb610c5a..8ab0f64b7a0ab5f 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/codepointat/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/codepointat/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.String.codePointAt The **`codePointAt()`** method of {{jsxref("String")}} values returns a non-negative integer that is the Unicode code point value of the character starting at the given index. Note that the index is still based on UTF-16 code units, not Unicode code points. -{{EmbedInteractiveExample("pages/js/string-codepointat.html","shorter")}} +{{EmbedInteractiveExample("pages/js/string-codepointat.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/string/fixed/index.md b/files/en-us/web/javascript/reference/global_objects/string/fixed/index.md index d93f91535c2eece..4422161cecb34cc 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/fixed/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/fixed/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.fixed --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`fixed()`** method of {{jsxref("String")}} values creates a string that embeds this string in a {{HTMLElement("tt")}} element (`str`), which causes this string to be displayed in a fixed-pitch font. diff --git a/files/en-us/web/javascript/reference/global_objects/string/fontcolor/index.md b/files/en-us/web/javascript/reference/global_objects/string/fontcolor/index.md index 56abc5d119d8e90..bc3ebc5072ae398 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/fontcolor/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/fontcolor/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.fontcolor --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`fontcolor()`** method of {{jsxref("String")}} values creates a string that embeds this string in a {{HTMLElement("font")}} element (`str`), which causes this string to be displayed in the specified font color. diff --git a/files/en-us/web/javascript/reference/global_objects/string/fontsize/index.md b/files/en-us/web/javascript/reference/global_objects/string/fontsize/index.md index 7ae4c5751475edf..4917ecdda121dad 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/fontsize/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/fontsize/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.fontsize --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`fontsize()`** method of {{jsxref("String")}} values creates a string that embeds this string in a {{HTMLElement("font")}} element (`str`), which causes this string to be displayed in the specified font size. diff --git a/files/en-us/web/javascript/reference/global_objects/string/fromcharcode/index.md b/files/en-us/web/javascript/reference/global_objects/string/fromcharcode/index.md index 0074b05204b59b9..aab6510670500c2 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/fromcharcode/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/fromcharcode/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.String.fromCharCode The **`String.fromCharCode()`** static method returns a string created from the specified sequence of UTF-16 code units. -{{EmbedInteractiveExample("pages/js/string-fromcharcode.html","shorter")}} +{{EmbedInteractiveExample("pages/js/string-fromcharcode.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/string/fromcodepoint/index.md b/files/en-us/web/javascript/reference/global_objects/string/fromcodepoint/index.md index bed4d5e0151bb57..013877b8e9e3373 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/fromcodepoint/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/fromcodepoint/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.String.fromCodePoint The **`String.fromCodePoint()`** static method returns a string created from the specified sequence of code points. -{{EmbedInteractiveExample("pages/js/string-fromcodepoint.html","shorter")}} +{{EmbedInteractiveExample("pages/js/string-fromcodepoint.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/string/index.md b/files/en-us/web/javascript/reference/global_objects/string/index.md index 7ae6bb0695e14f3..b63c7be2fd61aff 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/index.md @@ -13,8 +13,7 @@ sequence of characters. ## Description Strings are useful for holding data that can be represented in text form. Some of the -most-used operations on strings are to check their {{jsxref("String/length", - "length")}}, to build and concatenate them using the +most-used operations on strings are to check their {{jsxref("String/length", "length")}}, to build and concatenate them using the [+ and += string operators](/en-US/docs/Web/JavaScript/Guide/Expressions_and_operators#string_operators), checking for the existence or location of substrings with the {{jsxref("String.prototype.indexOf()", "indexOf()")}} method, or extracting substrings @@ -311,7 +310,7 @@ These properties are own properties of each `String` instance. - {{jsxref("String.prototype.startsWith()")}} - : Determines whether the calling string begins with the characters of string `searchString`. -- {{jsxref("String.prototype.substr()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.substr()")}} {{deprecated_inline}} - : Returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - {{jsxref("String.prototype.substring()")}} - : Returns a new string containing characters of the calling string from (or between) @@ -360,31 +359,31 @@ These properties are own properties of each `String` instance. > > They are of limited use, as they are based on a very old HTML standard and provide only a subset of the currently available HTML tags and attributes. Many of them create deprecated or non-standard markup today. In addition, they do simple string concatenation without any validation or sanitation, which makes them a potential security threat when directly inserted using [`innerHTML`](/en-US/docs/Web/API/Element/innerHTML). Use [DOM APIs](/en-US/docs/Web/API/Document_Object_Model) such as [`document.createElement()`](/en-US/docs/Web/API/Document/createElement) instead. -- {{jsxref("String.prototype.anchor()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.anchor()")}} {{deprecated_inline}} - : [``](/en-US/docs/Web/HTML/Element/a#name) (hypertext target) -- {{jsxref("String.prototype.big()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.big()")}} {{deprecated_inline}} - : {{HTMLElement("big")}} -- {{jsxref("String.prototype.blink()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.blink()")}} {{deprecated_inline}} - : `` -- {{jsxref("String.prototype.bold()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.bold()")}} {{deprecated_inline}} - : {{HTMLElement("b")}} -- {{jsxref("String.prototype.fixed()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.fixed()")}} {{deprecated_inline}} - : {{HTMLElement("tt")}} -- {{jsxref("String.prototype.fontcolor()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.fontcolor()")}} {{deprecated_inline}} - : [``](/en-US/docs/Web/HTML/Element/font#color) -- {{jsxref("String.prototype.fontsize()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.fontsize()")}} {{deprecated_inline}} - : [``](/en-US/docs/Web/HTML/Element/font#size) -- {{jsxref("String.prototype.italics()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.italics()")}} {{deprecated_inline}} - : {{HTMLElement("i")}} -- {{jsxref("String.prototype.link()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.link()")}} {{deprecated_inline}} - : [``](/en-US/docs/Web/HTML/Element/a#href) (link to URL) -- {{jsxref("String.prototype.small()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.small()")}} {{deprecated_inline}} - : {{HTMLElement("small")}} -- {{jsxref("String.prototype.strike()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.strike()")}} {{deprecated_inline}} - : {{HTMLElement("strike")}} -- {{jsxref("String.prototype.sub()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.sub()")}} {{deprecated_inline}} - : {{HTMLElement("sub")}} -- {{jsxref("String.prototype.sup()")}} {{Deprecated_Inline}} +- {{jsxref("String.prototype.sup()")}} {{deprecated_inline}} - : {{HTMLElement("sup")}} Note that these methods do not check if the string itself contains HTML tags, so it's possible to create invalid HTML: diff --git a/files/en-us/web/javascript/reference/global_objects/string/italics/index.md b/files/en-us/web/javascript/reference/global_objects/string/italics/index.md index 16f0e8212991674..4caf21e4e687e99 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/italics/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/italics/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.italics --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`italics()`** method of {{jsxref("String")}} values creates a string that embeds this string in an {{HTMLElement("i")}} element (`str`), which causes this string to be displayed as italic. diff --git a/files/en-us/web/javascript/reference/global_objects/string/link/index.md b/files/en-us/web/javascript/reference/global_objects/string/link/index.md index 200cd8a3edf8c82..0371d0519b20961 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/link/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/link/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.link --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`link()`** method of {{jsxref("String")}} values creates a string that embeds this string in an {{HTMLElement("a")}} element (`str`), to be used as a hypertext link to another URL. diff --git a/files/en-us/web/javascript/reference/global_objects/string/repeat/index.md b/files/en-us/web/javascript/reference/global_objects/string/repeat/index.md index 2c9f67630a5d96a..9fcb5c08586bc94 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/repeat/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/repeat/index.md @@ -10,7 +10,7 @@ browser-compat: javascript.builtins.String.repeat The **`repeat()`** method of {{jsxref("String")}} values constructs and returns a new string which contains the specified number of copies of this string, concatenated together. -{{EmbedInteractiveExample("pages/js/string-repeat.html","shorter")}} +{{EmbedInteractiveExample("pages/js/string-repeat.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/string/slice/index.md b/files/en-us/web/javascript/reference/global_objects/string/slice/index.md index 9a751ce14560dde..841bb6cb532ac86 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/slice/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/slice/index.md @@ -38,8 +38,8 @@ A new string containing the extracted section of the string. - 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 {{jsxref('Number', 'Number(indexStart)')}}), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using {{jsxref('Number', 'Number(indexEnd)')}}), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. +- If `indexStart` is omitted, undefined, or cannot be [converted to a number](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion), it's treated as `0`. +- If `indexEnd` is omitted, undefined, or cannot be [converted to a number](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion), 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/files/en-us/web/javascript/reference/global_objects/string/small/index.md b/files/en-us/web/javascript/reference/global_objects/string/small/index.md index 5d540fef403bf32..24ec51e9a1e8e50 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/small/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/small/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.small --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`small()`** method of {{jsxref("String")}} values creates a string that embeds this string in a {{HTMLElement("small")}} element (`str`), which causes this string to be displayed in a small font. diff --git a/files/en-us/web/javascript/reference/global_objects/string/strike/index.md b/files/en-us/web/javascript/reference/global_objects/string/strike/index.md index 02a35a915235d52..6de69c64d8a7116 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/strike/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/strike/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.strike --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`strike()`** method of {{jsxref("String")}} values creates a string that embeds this string in a {{HTMLElement("strike")}} element (`str`), which causes this string to be displayed as struck-out text. diff --git a/files/en-us/web/javascript/reference/global_objects/string/sub/index.md b/files/en-us/web/javascript/reference/global_objects/string/sub/index.md index 9080c404169de86..e6220226e9db43a 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/sub/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/sub/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.sub --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`sub()`** method of {{jsxref("String")}} values creates a string that embeds this string in a {{HTMLElement("sub")}} element (`str`), which causes this string to be displayed as subscript. diff --git a/files/en-us/web/javascript/reference/global_objects/string/substr/index.md b/files/en-us/web/javascript/reference/global_objects/string/substr/index.md index 7cbe6ca687289a6..e39fc83e0ea7402 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/substr/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/substr/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.substr --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`substr()`** method of {{jsxref("String")}} values returns a portion of this string, starting at the specified index and extending for a given number of characters afterwards. diff --git a/files/en-us/web/javascript/reference/global_objects/string/sup/index.md b/files/en-us/web/javascript/reference/global_objects/string/sup/index.md index 91b06448bc0d262..5c27b084718c31a 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/sup/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/sup/index.md @@ -7,7 +7,7 @@ status: browser-compat: javascript.builtins.String.sup --- -{{JSRef}} {{deprecated_header}} +{{JSRef}} {{Deprecated_Header}} The **`sup()`** method of {{jsxref("String")}} values creates a string that embeds this string in a {{HTMLElement("sup")}} element (`str`), which causes this string to be displayed as superscript. diff --git a/files/en-us/web/javascript/reference/global_objects/string/tolocalelowercase/index.md b/files/en-us/web/javascript/reference/global_objects/string/tolocalelowercase/index.md index b7dbd5b792b579b..94e0d5b9b47c9f2 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/tolocalelowercase/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/tolocalelowercase/index.md @@ -36,8 +36,7 @@ locale-specific case mappings. 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 {{jsxref("String.prototype.toLowerCase()", - "toLowerCase()")}}, but for some locales, such as Turkish, whose case mappings do not +cases, this will produce the same result as {{jsxref("String.prototype.toLowerCase()", "toLowerCase()")}}, 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. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/string/tolocaleuppercase/index.md b/files/en-us/web/javascript/reference/global_objects/string/tolocaleuppercase/index.md index 20087cfc036f86e..1beba9ee4ca7488 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/tolocaleuppercase/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/tolocaleuppercase/index.md @@ -36,8 +36,7 @@ locale-specific case mappings. 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 {{jsxref("String.prototype.toUpperCase()", - "toUpperCase()")}}, but for some locales, such as Turkish, whose case mappings do not +cases, this will produce the same result as {{jsxref("String.prototype.toUpperCase()", "toUpperCase()")}}, 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 diff --git a/files/en-us/web/javascript/reference/global_objects/string/tolowercase/index.md b/files/en-us/web/javascript/reference/global_objects/string/tolowercase/index.md index 2d6f33b8c1afd74..c44183e12b14af6 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/tolowercase/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/tolowercase/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.String.toLowerCase The **`toLowerCase()`** method of {{jsxref("String")}} values returns this string converted to lower case. -{{EmbedInteractiveExample("pages/js/string-tolowercase.html","shorter")}} +{{EmbedInteractiveExample("pages/js/string-tolowercase.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/string/touppercase/index.md b/files/en-us/web/javascript/reference/global_objects/string/touppercase/index.md index 2302257f80b6200..bd8dfbbac5bc36b 100644 --- a/files/en-us/web/javascript/reference/global_objects/string/touppercase/index.md +++ b/files/en-us/web/javascript/reference/global_objects/string/touppercase/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.String.toUpperCase The **`toUpperCase()`** method of {{jsxref("String")}} values returns this string converted to uppercase. -{{EmbedInteractiveExample("pages/js/string-touppercase.html","shorter")}} +{{EmbedInteractiveExample("pages/js/string-touppercase.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/symbol/description/index.md b/files/en-us/web/javascript/reference/global_objects/symbol/description/index.md index 5915afce61d5eeb..3fc2188c77575a5 100644 --- a/files/en-us/web/javascript/reference/global_objects/symbol/description/index.md +++ b/files/en-us/web/javascript/reference/global_objects/symbol/description/index.md @@ -13,7 +13,7 @@ The **`description`** accessor property of {{jsxref("Symbol")}} values returns a ## Description -{{JSxRef("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. +{{jsxref("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. ## Examples @@ -45,4 +45,4 @@ Symbol.for("foo").description; // "foo" ## See also - [Polyfill of `Symbol.prototype.description` in `core-js`](https://github.com/zloirock/core-js#ecmascript-symbol) -- {{JSxRef("Symbol.prototype.toString()")}} +- {{jsxref("Symbol.prototype.toString()")}} diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/buffer/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/buffer/index.md index 11580a8933b1490..b6b67bdfd1ed951 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/buffer/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/buffer/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.TypedArray.buffer The **`buffer`** accessor property of {{jsxref("TypedArray")}} instances returns the {{jsxref("ArrayBuffer")}} or {{jsxref("SharedArrayBuffer")}} referenced by this typed array at construction time. -{{EmbedInteractiveExample("pages/js/typedarray-buffer.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-buffer.html", "shorter")}} ## Description diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/bytelength/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/bytelength/index.md index df8ba296f6170fb..50ad33885979c00 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/bytelength/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/bytelength/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.TypedArray.byteLength The **`byteLength`** accessor property of {{jsxref("TypedArray")}} instances returns the length (in bytes) of this typed array. -{{EmbedInteractiveExample("pages/js/typedarray-bytelength.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-bytelength.html", "shorter")}} ## Description diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/bytes_per_element/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/bytes_per_element/index.md index cc5a9e536302ed9..f39ca6b420396fd 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/bytes_per_element/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/bytes_per_element/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.TypedArray.BYTES_PER_ELEMENT The **`TypedArray.BYTES_PER_ELEMENT`** static data property represents the size in bytes of each element in a typed array. -{{EmbedInteractiveExample("pages/js/typedarray-bytes-per-element.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-bytes-per-element.html", "shorter")}} ## Value diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/fill/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/fill/index.md index b74039ee6a09739..c49b7f02aac7c30 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/fill/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/fill/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.TypedArray.fill The **`fill()`** method of {{jsxref("TypedArray")}} instances changes all elements within a range of indices in a typed array to a static value. It returns the modified typed array. This method has the same algorithm as {{jsxref("Array.prototype.fill()")}}. -{{EmbedInteractiveExample("pages/js/typedarray-fill.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-fill.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/from/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/from/index.md index e0010fba053de4d..3ba3583a529c81c 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/from/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/from/index.md @@ -12,7 +12,7 @@ The **`TypedArray.from()`** static method creates a new from an array-like or iterable object. This method is nearly the same as {{jsxref("Array.from()")}}. -{{EmbedInteractiveExample("pages/js/typedarray-from.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-from.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/index.md index 38819946b7399dd..307294d65da1c12 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/index.md @@ -156,7 +156,7 @@ Where `TypedArray` is a constructor for one of the concrete types. ### Parameters - `typedArray` - - : When called with an instance of a `TypedArray` subclass, the `typedArray` gets copied into a new typed array. For a non-[bigint](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) `TypedArray` constructor, the `typedArray` parameter can only be of one of the non-[bigint](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) types (such as {{JSxRef("Int32Array")}}). Similarly, for a [bigint](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) `TypedArray` constructor ({{JSxRef("BigInt64Array")}} or {{JSxRef("BigUint64Array")}}), the `typedArray` parameter can only be of one of the [bigint](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) types. Each value in `typedArray` is converted to the corresponding type of the constructor before being copied into the new array. The length of the new typed array will be same as the length of the `typedArray` argument. + - : When called with an instance of a `TypedArray` subclass, the `typedArray` gets copied into a new typed array. For a non-[bigint](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) `TypedArray` constructor, the `typedArray` parameter can only be of one of the non-[bigint](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) types (such as {{jsxref("Int32Array")}}). Similarly, for a [bigint](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) `TypedArray` constructor ({{jsxref("BigInt64Array")}} or {{jsxref("BigUint64Array")}}), the `typedArray` parameter can only be of one of the [bigint](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) types. Each value in `typedArray` is converted to the corresponding type of the constructor before being copied into the new array. The length of the new typed array will be same as the length of the `typedArray` argument. - `object` - : When called with an object that's not a `TypedArray` instance, a new typed array is created in the same way as the [`TypedArray.from()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from) method. - `length` {{optional_inline}} diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/length/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/length/index.md index e6bb15cb86a216b..51f453edc3d5506 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/length/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/length/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.TypedArray.length The **`length`** accessor property of {{jsxref("TypedArray")}} instances returns the length (in elements) of this typed array. -{{EmbedInteractiveExample("pages/js/typedarray-length.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-length.html", "shorter")}} ## Description diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/of/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/of/index.md index 263360c60cf6e94..5bcf0c72a182fe7 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/of/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/of/index.md @@ -11,7 +11,7 @@ The **`TypedArray.of()`** static method creates a new [typed array](/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects) from a variable number of arguments. This method is nearly the same as {{jsxref("Array.of()")}}. -{{EmbedInteractiveExample("pages/js/typedarray-of.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-of.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/reverse/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/reverse/index.md index 372572a019f186b..b9fd699ed779e7d 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/reverse/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/reverse/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.TypedArray.reverse The **`reverse()`** method of {{jsxref("TypedArray")}} instances reverses a typed array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same typed array, the first typed array element now becoming the last, and the last typed array element becoming the first. In other words, elements order in the typed array will be turned towards the direction opposite to that previously stated. This method has the same algorithm as {{jsxref("Array.prototype.reverse()")}}. -{{EmbedInteractiveExample("pages/js/typedarray-reverse.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-reverse.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/slice/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/slice/index.md index 68866d2887ab6c4..a4e8f3032cd7f5d 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/slice/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/slice/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.TypedArray.slice The **`slice()`** method of {{jsxref("TypedArray")}} instances returns a copy of a portion of a typed array into a new typed array object selected from `start` to `end` (`end` not included) where `start` and `end` represent the index of items in that typed array. The original typed array will not be modified. This method has the same algorithm as {{jsxref("Array.prototype.slice()")}}. -{{EmbedInteractiveExample("pages/js/typedarray-slice.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-slice.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/sort/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/sort/index.md index 489081b777e951a..752047a3db0d072 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/sort/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/sort/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.TypedArray.sort The **`sort()`** method of {{jsxref("TypedArray")}} instances sorts the elements of a typed array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same typed array, now sorted. This method has the same algorithm as {{jsxref("Array.prototype.sort()")}}, except that it sorts the values numerically instead of as strings by default. -{{EmbedInteractiveExample("pages/js/typedarray-sort.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-sort.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/typedarray/tostring/index.md b/files/en-us/web/javascript/reference/global_objects/typedarray/tostring/index.md index 540f17090f78719..f177dd3ad82db18 100644 --- a/files/en-us/web/javascript/reference/global_objects/typedarray/tostring/index.md +++ b/files/en-us/web/javascript/reference/global_objects/typedarray/tostring/index.md @@ -9,7 +9,7 @@ browser-compat: javascript.builtins.TypedArray.toString The **`toString()`** method of {{jsxref("TypedArray")}} instances returns a string representing the specified typed array and its elements. This method has the same algorithm as {{jsxref("Array.prototype.toString()")}}. -{{EmbedInteractiveExample("pages/js/typedarray-tostring.html","shorter")}} +{{EmbedInteractiveExample("pages/js/typedarray-tostring.html", "shorter")}} ## Syntax diff --git a/files/en-us/web/javascript/reference/global_objects/weakref/index.md b/files/en-us/web/javascript/reference/global_objects/weakref/index.md index a19cd877405d017..8043d2fa16aae83 100644 --- a/files/en-us/web/javascript/reference/global_objects/weakref/index.md +++ b/files/en-us/web/javascript/reference/global_objects/weakref/index.md @@ -47,7 +47,7 @@ Here are some specific points included by the authors in the [proposal](https:// These properties are defined on `WeakRef.prototype` and shared by all `WeakRef` instances. -- {{jsxref("Object/constructor", "WeakRef.prototype.constructor")}} {{Optional_Inline}} +- {{jsxref("Object/constructor", "WeakRef.prototype.constructor")}} {{optional_inline}} - : The constructor function that created the instance object. For `WeakRef` instances, the initial value is the {{jsxref("WeakRef/WeakRef", "WeakRef")}} constructor.