Skip to content

Commit

Permalink
Restyled by whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits committed Mar 6, 2022
1 parent d713198 commit 38911ed
Show file tree
Hide file tree
Showing 29 changed files with 337 additions and 337 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ find . -name *right.html -type f -exec sed -i 's/target="_parent"//g' {} +
<details>
<summary>Click to expand!</summary>
[![@algolia**](https://avatars.githubusercontent.com/u/2034458?s=40&v=4)](https://github.com/algolia)[algolia / algoliasearch-client-javascript](https://github.com/algolia/algoliasearch-client-javascript)@algolia/client-search
`^ 4.10.3`
Expand Down
8 changes: 4 additions & 4 deletions src/pages/docs/js-tips/all.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The `Promise.all()` method takes an iterable of promises as an input, and return

### Parameters

`iterable`
`iterable`
An [iterable](../../iteration_protocols#the_iterable_protocol) object such as an [`Array`](../array).

### Return value
Expand Down Expand Up @@ -193,7 +193,7 @@ It is possible to change this behavior by handling possible rejections:

## Specifications

<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-promise.all">ECMAScript Language Specification (ECMAScript)
<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-promise.all">ECMAScript Language Specification (ECMAScript)
<br/>

<span class="small">#sec-promise.all</span></a></td></tr></tbody></table>
Expand Down Expand Up @@ -229,6 +229,6 @@ No
- [`Promise`](../promise)
- [`Promise.race()`](race)

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all</a>
8 changes: 4 additions & 4 deletions src/pages/docs/js-tips/allsettled.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ In comparison, the Promise returned by [`Promise.all()`](all) may be more approp

### Parameters

`iterable`
`iterable`
An [iterable](../../iteration_protocols) object, such as an [`Array`](../array), in which each member is a `Promise`.

### Return value
Expand Down Expand Up @@ -57,7 +57,7 @@ For each outcome object, a `status` string is present. If the status is `fulfill

## Specifications

<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-promise.allsettled">ECMAScript Language Specification (ECMAScript)
<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-promise.allsettled">ECMAScript Language Specification (ECMAScript)
<br/>

<span class="small">#sec-promise.allsettled</span></a></td></tr></tbody></table>
Expand Down Expand Up @@ -96,6 +96,6 @@ No
- [`Promise`](../promise)
- [`Promise.all()`](all)

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled</a>
8 changes: 4 additions & 4 deletions src/pages/docs/js-tips/any.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ template: docs

### Parameters

`iterable`
`iterable`
An [iterable](../../iteration_protocols#the_iterable_protocol) object, such as an [`Array`](../array).

### Return value
Expand Down Expand Up @@ -114,7 +114,7 @@ In this example, we have a function that fetches an image and returns a blob. We

## Specifications

<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-promise.any">ECMAScript Language Specification (ECMAScript)
<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-promise.any">ECMAScript Language Specification (ECMAScript)
<br/>

<span class="small">#sec-promise.any</span></a></td></tr></tbody></table>
Expand Down Expand Up @@ -152,6 +152,6 @@ No
- [`Promise.all()`](all)
- [`Promise.race()`](race)

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any</a>
78 changes: 39 additions & 39 deletions src/pages/docs/js-tips/array.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ To help explain these properties and elements, see this example and then refer t

The properties and elements returned from this match are as follows:

<table><thead><tr class="header"><th>Property/Element</th><th>Description</th><th>Example</th></tr></thead><tbody><tr class="odd"><td><code>input</code>
<table><thead><tr class="header"><th>Property/Element</th><th>Description</th><th>Example</th></tr></thead><tbody><tr class="odd"><td><code>input</code>
<br/>

<span class="badge inline readonly">Read only </span></td><td>The original string against which the regular expression was matched.</td><td><code>"cdbBdbsbz"</code></td></tr><tr class="even"><td><code>index</code>
Expand All @@ -203,126 +203,126 @@ The properties and elements returned from this match are as follows:

## Constructor

[`Array()`](array/array)
[`Array()`](array/array)
Creates a new `Array` object.

## Static properties

[`get Array[@@species]`](array/@@species)
[`get Array[@@species]`](array/@@species)
The constructor function is used to create derived objects.

## Static methods

[`Array.from()`](array/from)
[`Array.from()`](array/from)
Creates a new `Array` instance from an array-like or iterable object.

[`Array.isArray()`](array/isarray)
[`Array.isArray()`](array/isarray)
Returns `true` if the argument is an array, or `false` otherwise.

[`Array.of()`](array/of)
[`Array.of()`](array/of)
Creates a new `Array` instance with a variable number of arguments, regardless of number or type of the arguments.

## Instance properties

[`Array.prototype.length`](array/length)
[`Array.prototype.length`](array/length)
Reflects the number of elements in an array.

[`Array.prototype[@@unscopables]`](array/@@unscopables)
[`Array.prototype[@@unscopables]`](array/@@unscopables)
A symbol containing property names to exclude from a [`with`](../statements/with) binding scope.

## Instance methods

[`Array.prototype.at()`](array/at)<span class="icon experimental" viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" role="img"> This is an experimental API that should not be used in production code. </span>
[`Array.prototype.at()`](array/at)<span class="icon experimental" viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" role="img"> This is an experimental API that should not be used in production code. </span>
Returns the array item at the given index. Accepts negative integers, which count back from the last item.

[`Array.prototype.concat()`](array/concat)
[`Array.prototype.concat()`](array/concat)
Returns a new array that is this array joined with other array(s) and/or value(s).

[`Array.prototype.copyWithin()`](array/copywithin)
[`Array.prototype.copyWithin()`](array/copywithin)
Copies a sequence of array elements within the array.

[`Array.prototype.entries()`](array/entries)
[`Array.prototype.entries()`](array/entries)
Returns a new `Array Iterator` object that contains the key/value pairs for each index in the array.

[`Array.prototype.every()`](array/every)
[`Array.prototype.every()`](array/every)
Returns `true` if every element in this array satisfies the testing function.

[`Array.prototype.fill()`](array/fill)
[`Array.prototype.fill()`](array/fill)
Fills all the elements of an array from a start index to an end index with a static value.

[`Array.prototype.filter()`](array/filter)
[`Array.prototype.filter()`](array/filter)
Returns a new array containing all elements of the calling array for which the provided filtering function returns `true`.

[`Array.prototype.find()`](array/find)
[`Array.prototype.find()`](array/find)
Returns the found `element` in the array, if some element in the array satisfies the testing function, or `undefined` if not found.

[`Array.prototype.findIndex()`](array/findindex)
[`Array.prototype.findIndex()`](array/findindex)
Returns the found index in the array, if an element in the array satisfies the testing function, or `-1` if not found.

[`Array.prototype.forEach()`](array/foreach)
[`Array.prototype.forEach()`](array/foreach)
Calls a function for each element in the array.

[`Array.prototype.includes()`](array/includes)
[`Array.prototype.includes()`](array/includes)
Determines whether the array contains a value, returning `true` or `false` as appropriate.

[`Array.prototype.indexOf()`](array/indexof)
[`Array.prototype.indexOf()`](array/indexof)
Returns the first (least) index of an element within the array equal to an element, or `-1` if none is found.

[`Array.prototype.join()`](array/join)
[`Array.prototype.join()`](array/join)
Joins all elements of an array into a string.

[`Array.prototype.keys()`](array/keys)
[`Array.prototype.keys()`](array/keys)
Returns a new `Array Iterator` that contains the keys for each index in the array.

[`Array.prototype.lastIndexOf()`](array/lastindexof)
[`Array.prototype.lastIndexOf()`](array/lastindexof)
Returns the last (greatest) index of an element within the array equal to an element, or `-1` if none is found.

[`Array.prototype.map()`](array/map)
[`Array.prototype.map()`](array/map)
Returns a new array containing the results of calling a function on every element in this array.

[`Array.prototype.pop()`](array/pop)
[`Array.prototype.pop()`](array/pop)
Removes the last element from an array and returns that element.

[`Array.prototype.push()`](array/push)
[`Array.prototype.push()`](array/push)
Adds one or more elements to the end of an array, and returns the new `length` of the array.

[`Array.prototype.reduce()`](array/reduce)
[`Array.prototype.reduce()`](array/reduce)
Apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value.

[`Array.prototype.reduceRight()`](array/reduceright)
[`Array.prototype.reduceRight()`](array/reduceright)
Apply a function against an accumulator&gt; and each value of the array (from right-to-left) as to reduce it to a single value.

[`Array.prototype.reverse()`](array/reverse)
[`Array.prototype.reverse()`](array/reverse)
Reverses the order of the elements of an array _in place_. (First becomes the last, last becomes first.)

[`Array.prototype.shift()`](array/shift)
[`Array.prototype.shift()`](array/shift)
Removes the first element from an array and returns that element.

[`Array.prototype.slice()`](array/slice)
[`Array.prototype.slice()`](array/slice)
Extracts a section of the calling array and returns a new array.

[`Array.prototype.some()`](array/some)
[`Array.prototype.some()`](array/some)
Returns `true` if at least one element in this array satisfies the provided testing function.

[`Array.prototype.sort()`](array/sort)
[`Array.prototype.sort()`](array/sort)
Sorts the elements of an array in place and returns the array.

[`Array.prototype.splice()`](array/splice)
[`Array.prototype.splice()`](array/splice)
Adds and/or removes elements from an array.

[`Array.prototype.toLocaleString()`](array/tolocalestring)
[`Array.prototype.toLocaleString()`](array/tolocalestring)
Returns a localized string representing the array and its elements. Overrides the [`Object.prototype.toLocaleString()`](object/tolocalestring) method.

[`Array.prototype.toString()`](array/tostring)
[`Array.prototype.toString()`](array/tostring)
Returns a string representing the array and its elements. Overrides the [`Object.prototype.toString()`](object/tostring) method.

[`Array.prototype.unshift()`](array/unshift)
[`Array.prototype.unshift()`](array/unshift)
Adds one or more elements to the front of an array, and returns the new `length` of the array.

[`Array.prototype.values()`](array/values)
[`Array.prototype.values()`](array/values)
Returns a new `Array Iterator` object that contains the values for each index in the array.

[`Array.prototype[@@iterator]()`](array/@@iterator)
[`Array.prototype[@@iterator]()`](array/@@iterator)
Returns a new `Array Iterator` object that contains the values for each index in the array.

## Examples
Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs/js-tips/arrow_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ An **arrow function expression** is a compact alternative to a traditional [func

### Comparing traditional functions to arrow functions

Let's decompose a "traditional function" down to the simplest "arrow function" step-by-step:
Let's decompose a "traditional function" down to the simplest "arrow function" step-by-step:
NOTE: Each step along the way is a valid "arrow function"

// Traditional Function
Expand Down Expand Up @@ -427,7 +427,7 @@ Although the arrow in an arrow function is not an operator, arrow functions have

## Specifications

<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-arrow-function-definitions">ECMAScript Language Specification (ECMAScript)
<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-arrow-function-definitions">ECMAScript Language Specification (ECMAScript)
<br/>

<span class="small">#sec-arrow-function-definitions</span></a></td></tr></tbody></table>
Expand Down
14 changes: 7 additions & 7 deletions src/pages/docs/js-tips/async_function.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Async functions may also be defined [as expressions](../operators/async_function

### Parameters

`name`
`name`
The function's name.

`param`
`param`
The name of an argument to be passed to the function.

`statements`
`statements`
The statements comprising the body of the function. The `await` mechanism may be used.

### Return value
Expand Down Expand Up @@ -204,7 +204,7 @@ For example, in the following code an unhandled promise rejection error will be

In `sequentialStart`, execution suspends 2 seconds for the first `await`, and then another second for the second `await`. The second timer is not created until the first has already fired, so the code finishes after 3 seconds.

In `concurrentStart`, both timers are created and then `await`ed. The timers run concurrently, which means the code finishes in 2 rather than 3 seconds, i.e. the slowest timer.
In `concurrentStart`, both timers are created and then `await`ed. The timers run concurrently, which means the code finishes in 2 rather than 3 seconds, i.e. the slowest timer.
However, the `await` calls still run in series, which means the second `await` will wait for the first one to finish. In this case, the result of the fastest timer is processed after the slowest.

If you wish to safely perform two or more jobs in parallel, you must await a call to `Promise.all`, or `Promise.allSettled`.
Expand Down Expand Up @@ -267,7 +267,7 @@ This highlights the subtle difference between `return foo;` and `return await fo

## Specifications

<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-async-function-definitions">ECMAScript Language Specification (ECMAScript)
<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-async-function-definitions">ECMAScript Language Specification (ECMAScript)
<br/>

<span class="small">#sec-async-function-definitions</span></a></td></tr></tbody></table>
Expand Down Expand Up @@ -305,6 +305,6 @@ No
- [`await`](../operators/await)
- ["Decorating Async Javascript Functions" on "innolitics.com"](https://innolitics.com/10x/javascript-decorators-for-promise-returning-functions/)

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function</a>
14 changes: 7 additions & 7 deletions src/pages/docs/js-tips/bind.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ The `bind()` method creates a new function that, when called, has its `this` key

### Parameters

`thisArg`
`thisArg`
The value to be passed as the `this` parameter to the target function `func` when the bound function is called. The value is ignored if the bound function is constructed using the [`new`](../../operators/new) operator. When using `bind` to create a function (supplied as a callback) inside a `setTimeout`, any primitive value passed as `thisArg` is converted to object. If no arguments are provided to `bind `, or if the `thisArg` is `null` or `undefined`, the `this` of the executing scope is treated as the `thisArg` for the new function.

`arg1, arg2, ...argN` <span class="badge inline optional">Optional</span>
`arg1, arg2, ...argN` <span class="badge inline optional">Optional</span>
Arguments to prepend to arguments provided to the bound function when invoking `func`.

### Return value
Expand All @@ -40,16 +40,16 @@ The `bind()` function creates a new **bound function**, which is an _exotic func

A bound function has the following internal properties:

`[[BoundTargetFunction]]`
`[[BoundTargetFunction]]`
The wrapped function object

`[[BoundThis]]`
`[[BoundThis]]`
The value that is always passed as `this` value when calling the wrapped function.

`[[BoundArguments]]`
`[[BoundArguments]]`
A list of values whose elements are used as the first arguments to any call to the wrapped function.

`[[Call]]`
`[[Call]]`
Executes code associated with this object. Invoked via a function call expression. The arguments to the internal method are a `this` value and a list containing the arguments passed to the function by a call expression.

When a bound function is called, it calls internal method `[[Call]]` on `[[BoundTargetFunction]]`, with following arguments `Call(boundThis, ...args)`. Where `boundThis` is `[[BoundThis]]`, `args` is `[[BoundArguments]]`, followed by the arguments passed by the function call.
Expand Down Expand Up @@ -303,7 +303,7 @@ If you choose to use this partial implementation, **you must not rely on those c

## Specifications

<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-function.prototype.bind">ECMAScript Language Specification (ECMAScript)
<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-function.prototype.bind">ECMAScript Language Specification (ECMAScript)
<br/>

<span class="small">#sec-function.prototype.bind</span></a></td></tr></tbody></table>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/js-tips/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ If you're experimenting with code in a web browser, such as the Firefox Web Cons

## Specifications

<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-class-definitions">ECMAScript (ECMA-262)
<table><thead><tr class="header"><th>Specification</th></tr></thead><tbody><tr class="odd"><td><a href="https://tc39.es/ecma262/#sec-class-definitions">ECMAScript (ECMA-262)
<br/>

<span class="small">The definition of 'Class definitions' in that specification.</span></a></td></tr></tbody></table>
Expand Down
Loading

0 comments on commit 38911ed

Please sign in to comment.