diff --git a/files/en-us/learn/javascript/first_steps/silly_story_generator/index.md b/files/en-us/learn/javascript/first_steps/silly_story_generator/index.md index 9da9e0b5522cc78..82bf8291a624639 100644 --- a/files/en-us/learn/javascript/first_steps/silly_story_generator/index.md +++ b/files/en-us/learn/javascript/first_steps/silly_story_generator/index.md @@ -55,7 +55,7 @@ You have been provided with some raw HTML/CSS and a few text strings and JavaScr - Generates a silly story when the "Generate random story" button is pressed. - Replaces the default name "Bob" in the story with a custom name, only if a custom name is entered into the "Enter custom name" text field before the generate button is pressed. - Converts the default US weight and temperature quantities and units in the story into UK equivalents if the UK radio button is checked before the generate button is pressed. -- Generates a new random silly story everytime the button is pressed. +- Generates a new random silly story every time the button is pressed. The following screenshot shows an example of what the finished program should output: diff --git a/files/en-us/learn/javascript/objects/basics/index.md b/files/en-us/learn/javascript/objects/basics/index.md index 8cd7620c89485b0..ab40b69b67af562 100644 --- a/files/en-us/learn/javascript/objects/basics/index.md +++ b/files/en-us/learn/javascript/objects/basics/index.md @@ -177,7 +177,7 @@ person['name']['first'] This looks very similar to how you access the items in an array, and it is basically the same thing — instead of using an index number to select an item, you are using the name associated with each member's value. It is no wonder that objects are sometimes called **associative arrays** — they map strings to values in the same way that arrays map numbers to values. -Dot notation is generally preferred over bracket notation because it is more succint and easier to read. +Dot notation is generally preferred over bracket notation because it is more succinct and easier to read. However there are some cases where you have to use brackets. For example, if an object property name is defined at runtime then you can't use dot notation to access the value, but you can pass the name as a variable inside brackets as shown with `input` below: diff --git a/files/en-us/web/accessibility/information_for_web_authors/index.md b/files/en-us/web/accessibility/information_for_web_authors/index.md index a8961ae5493a26b..9d7056cc37b0438 100644 --- a/files/en-us/web/accessibility/information_for_web_authors/index.md +++ b/files/en-us/web/accessibility/information_for_web_authors/index.md @@ -21,7 +21,7 @@ tags: ## How-to's -1. [Accessiblity for frontend developers](https://accessibility.digital.gov/front-end/getting-started/) +1. [Accessibility for frontend developers](https://accessibility.digital.gov/front-end/getting-started/) A brief guide from the U.S. General Services administration’s Technology Transformation Services covering several accessibility topics with links to "how-to" videos and to related WCAG references. diff --git a/files/en-us/web/api/readablestreambyobreader/read/index.md b/files/en-us/web/api/readablestreambyobreader/read/index.md index a91d5e44f80fbd6..6694ff24501605e 100644 --- a/files/en-us/web/api/readablestreambyobreader/read/index.md +++ b/files/en-us/web/api/readablestreambyobreader/read/index.md @@ -14,7 +14,7 @@ browser-compat: api.ReadableStreamBYOBReader.read {{APIRef("Streams")}} The **`read()`** method of the {{domxref("ReadableStreamBYOBReader")}} interface is used to read data into a view on a user-supplied buffer from an associated [readable byte stream](/en-US/docs/Web/API/Streams_API/Using_readable_byte_streams). -A request for data will be statisfied from the stream's internal queues if there is any data present. +A request for data will be satisfied from the stream's internal queues if there is any data present. If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a {{jsxref("Promise")}}. diff --git a/files/en-us/web/api/streams_api/using_readable_byte_streams/index.md b/files/en-us/web/api/streams_api/using_readable_byte_streams/index.md index 0698ef6b59b7876..1be9334360946bd 100644 --- a/files/en-us/web/api/streams_api/using_readable_byte_streams/index.md +++ b/files/en-us/web/api/streams_api/using_readable_byte_streams/index.md @@ -24,7 +24,7 @@ This article explains how readable byte streams compare to normal "default" stre > **Note:** Readable byte streams are almost identical to "normal" readable streams and almost all of the concepts are the same. > This article assumes that you already understand those concepts and will only be covering them superficially (if at all). -> If you're not familiar with the relevent concepts, please first read: [Using readable streams](/en-US/docs/Web/API/Streams_API/Using_readable_streams), [Streams concepts and usage overview](/en-US/docs/Web/API/Streams_API#concepts_and_usage), and [Streams API concepts](/en-US/docs/Web/API/Streams_API/Concepts). +> If you're not familiar with the relevant concepts, please first read: [Using readable streams](/en-US/docs/Web/API/Streams_API/Using_readable_streams), [Streams concepts and usage overview](/en-US/docs/Web/API/Streams_API#concepts_and_usage), and [Streams API concepts](/en-US/docs/Web/API/Streams_API/Concepts). ## Overview @@ -70,17 +70,17 @@ This live example shows how to create a readable byte stream with a _push_ under Unlike with a pull underlying byte source, data can arrive at any time. Therefore the underlying source must use `controller.byobRequest` to transfer incoming data if one exists, and otherwise enqueue the data into the stream's internal queues. -Further, since the data can arrive at any time the monitoring behaviour is set up in the `underlyingSource.start()` callback function. +Further, since the data can arrive at any time the monitoring behavior is set up in the `underlyingSource.start()` callback function. The example is highly influenced by a push byte source example in the stream specification. It uses a mocked "hypothetical socket" source that supplies data of arbitrary sizes. -The reader is deliberately delayed at various points to allow the underlying source to use both transfer and enqueing to send data to the stream. +The reader is deliberately delayed at various points to allow the underlying source to use both transfer and enqueuing to send data to the stream. Backpressure support is not demonstrated. > **Note:** An underlying byte source can also be used with a default reader. > If automatic buffer allocation is enabled the controller will supply fixed-size buffers for zero-copy transfers when there is an outstanding request from a reader and the stream's internal queues are empty. > If automatic buffer allocation is not enabled then all data from the byte stream will always be enqueued. -> This is similar to the behaviour shown in the "pull: underlying byte source examples. +> This is similar to the behavior shown in the "pull: underlying byte source examples. #### Mocked underlying socket source @@ -153,13 +153,13 @@ class MockHypotheticalSocket { getNumberRandomBytesSocket() { //Capped to remaining data and the max min return-per-read range const remaining_data = this.max_data - this.data_read; - let numberBytesRecieved = 0; + let numberBytesReceived = 0; if (remaining_data < this.min_per_read) { - numberBytesRecieved = remaining_data; + numberBytesReceived = remaining_data; } else { - numberBytesRecieved = this.getRandomIntInclusive(this.min_per_read, Math.min(this.max_per_read, remaining_data)); + numberBytesReceived = this.getRandomIntInclusive(this.min_per_read, Math.min(this.max_per_read, remaining_data)); } - return numberBytesRecieved; + return numberBytesReceived; } /* Return random number between two values */ @@ -253,9 +253,9 @@ This ensures that the stream is handed a {{domxref("ReadableByteStreamController Since data can arrive at the socket before the consumer is ready to handle it, everything about reading the underlying source is configured in the `start()` callback method (we don't wait on a pull to start handling data). The implementation opens the "socket" and calls `select2()` to request data. -When the retured promise resolves the code checks if `controller.byobRequest` exists (is not `null`), and if so calls `socket.readInto()` to copy data into the request and transfer it. -If `byobRequest` does not exist there is no outstanding request from a consuming stream that can be satisifed as as zero-copy transfer. -In this case, `constroller.enqueue()` used to copy data to the stream internal queues. +When the returned promise resolves the code checks if `controller.byobRequest` exists (is not `null`), and if so calls `socket.readInto()` to copy data into the request and transfer it. +If `byobRequest` does not exist there is no outstanding request from a consuming stream that can be satisfied as as zero-copy transfer. +In this case, `controller.enqueue()` used to copy data to the stream internal queues. The `select2()` request for more data is reposted until a request is returned with no data. A this point the controller is used to close the stream. @@ -400,7 +400,7 @@ reader.closed #### Result The logging from the underlying push source (left) and consumer (right) are shown below. -Not the period in the middle where data is equeued rather than transferred as a zero-copy operation. +Not the period in the middle where data is enqueued rather than transferred as a zero-copy operation. {{EmbedLiveSample("Underlying push source with default reader","100%","500px")}} @@ -564,9 +564,9 @@ function makeReadableByteFileStream(filename) { }, async pull(controller) { // Called when there is a pull request for data - const theview = controller.byobRequest.view; + const theView = controller.byobRequest.view; const {bytesRead, buffer} = - await fileHandle.read(theview.buffer, theview.offset, theview.length, position) + await fileHandle.read(theView.buffer, theView.offset, theView.length, position) if (bytesRead === 0) { await fileHandle.close(); controller.close(); @@ -787,9 +787,9 @@ function makeReadableByteFileStream(filename) { }, async pull(controller) { // Called when there is a pull request for data - const theview = controller.byobRequest.view; + const theView = controller.byobRequest.view; const {bytesRead, buffer} = - await fileHandle.read(theview.buffer, theview.offset, theview.length, position) + await fileHandle.read(theView.buffer, theView.offset, theView.length, position) if (bytesRead === 0) { await fileHandle.close(); controller.close(); @@ -1002,8 +1002,8 @@ function makeReadableByteFileStream(filename) { async pull(controller) { // Called when there is a pull request for data if (controller.byobRequest) { - const theview = controller.byobRequest.view; - const {bytesRead, buffer} = await fileHandle.read(theview.buffer, theview.offset, theview.length, position) + const theView = controller.byobRequest.view; + const {bytesRead, buffer} = await fileHandle.read(theView.buffer, theView.offset, theView.length, position) if (bytesRead === 0) { await fileHandle.close(); controller.close(); diff --git a/files/en-us/web/api/web_workers_api/structured_clone_algorithm/index.md b/files/en-us/web/api/web_workers_api/structured_clone_algorithm/index.md index 6ada80d16b7d543..ac6192f8d675f3f 100644 --- a/files/en-us/web/api/web_workers_api/structured_clone_algorithm/index.md +++ b/files/en-us/web/api/web_workers_api/structured_clone_algorithm/index.md @@ -116,7 +116,7 @@ It clones by recursing through the input object while maintaining a map of previ Native Error types

The error name must be one of: {{jsxref("Error")}}, {{JSxRef("EvalError")}}, {{JSxRef("RangeError")}}, {{JSxRef("ReferenceError")}}, {{JSxRef("SyntaxError")}}, {{JSxRef("TypeError")}}, {{JSxRef("URIError")}} (or will be set to "Error").

-

Browsers must serialize the properties name and message, and are expected to serialise "interesting" other properties of the errors such as stack, cause, etc.

+

Browsers must serialize the properties name and message, and are expected to serialize "interesting" other properties of the errors such as stack, cause, etc.

{{JSxRef("AggregateError")}} support is expected to be added to the specification in whatwg/html#5749 (and is already supported in some browsers).