Update for ch5.md (Section - Multiple Views) #1090
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If we try using of "buf" = 2 bits, we will have exceptions for all variables.
Browser: Chrome latest
Exception:
VM200:2 Uncaught RangeError: Invalid typed array length: 2
at typedArrayConstructByArrayBuffer ()
at new Uint16Array (native)
at :2:13
Valid example:
var buf1 = new ArrayBuffer( 4 );
var first = new Uint16Array( buf1, 0, 2 )[0];
var buf2 = new ArrayBuffer( 3 );
var second = new Uint8Array( buf2, 2, 1 )[0];
var buf3 = new ArrayBuffer( 4 );
var third = new Uint8Array( buf3, 3, 1 )[0];
var buf4 = new ArrayBuffer( 20 );
var fourth = new Float32Array( buf4, 4, 4 )[0];
=========================
Need add to example "buf" = 20 or set custom "buf" for each variable.
After that please update the text if this remark is correct.