Skip to content

Comments

Make all TypedArray constructor examples consistent, remove var#17830

Merged
wbamberg merged 40 commits intomainfrom
unknown repository
Jul 1, 2022
Merged

Make all TypedArray constructor examples consistent, remove var#17830
wbamberg merged 40 commits intomainfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Jul 1, 2022

Summary

This makes the example snippet used between the constructor of every TypedArray subclass consistent (modulo the detail for Uint8ClampedArray). This also ensures that every page is tagged with the class name.

I added spacing where appropriate, removed any remaining use of var, renamed variables to fit common naming conventions, removed a redundant line, added a note about the byteOffset, and propagated this example through every subclass.

Motivation

This makes it obvious as to what changes between each type, by eliminating smaller unnecessary differences. Regarding var, this encourages better coding practise. Lastly, it makes some broken examples function now.

Supporting details

N/A.

Related issues

None.

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@ghost ghost self-requested a review as a code owner July 1, 2022 00:25
@ghost ghost requested review from Josh-Cena and removed request for a team July 1, 2022 00:25
@github-actions github-actions bot added the Content:JS JavaScript docs label Jul 1, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2022

Preview URLs

Flaws

None! 🎉

External URLs

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array
Title: Float64Array
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array
Title: Int16Array
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array
Title: Int32Array
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array
Title: Int8Array
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array
Title: Uint32Array
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
Title: Uint8Array
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array
Title: BigUint64Array
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array
Title: Float32Array
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array
Title: Uint16Array
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array
Title: BigInt64Array
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray
Title: Uint8ClampedArray
on GitHub

No new external URLs

(this comment was updated 2022-07-01 01:13:53.355528)

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @phosra , this is a very nice update!

@wbamberg wbamberg merged commit 919c0fd into mdn:main Jul 1, 2022
@ghost ghost deleted the patch-3 branch July 5, 2022 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:JS JavaScript docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant