Mention endianness and alignment in section ArrayBuffers, binary arrays
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- documentation
Research direction
Find the tutorial section titled “ArrayBuffers, binary arrays” and review the existing explanation around typed arrays and DataView. Add clear notes covering alignment restrictions and the endianness distinction described in the issue, including the relevant behavior for Uint16Array and dataView.getUint16(). Done when readers can understand both caveats from that section.
Written by the indexing model from the issue text.
Description
-
Alignment: My browser (Firefox 87.0 on Linux x86_64) doesn't let me create an unaligned Uint16Array. I. e.,
new Uint16Array(b, 1, 1)on a 4-byte array buffer givesRangeError: attempting to construct out-of-bounds TypedArray on ArrayBuffer. In the standard that is 22.2.1.5.13a. -
Endianness: Uint16Array is little-endian on my machine. I just learned that this is machine dependent (https://stackoverflow.com/questions/7869752/javascript-typed-arrays-and-endianness). In contrast,
dataView.getUint16()is big-endian, unless the second argument is true.
Hope this helps.
- Dominant language
- HTML
- Stars
- 25.5k
- Forks
- 4k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from javascript-tutorial/en.javascript.info
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Keyboard events: keydown filtering example can't block IME-composed input (Korean/Japanese/Chinese) Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
javascript-tutorial/en.javascript.info#3978 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
All issues in javascript-tutorial/en.javascript.info
Similar issues
-
sync-en
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
BasedHardware/omi#15662 · 1 comment ·
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100