Skip to content

Conversation

sJJdGG
Copy link

@sJJdGG sJJdGG commented Jul 28, 2018

As mentioned in MDN and other sources TypedArray(length) constructor makes a view of length elements not bytes.
It can be also tested by:

var x = new Uint32Array(2);
console.log(x.length) // 2
console.log(x.byteLength) // 8
x[1] = 25;
console.log(x[1]); // 25

As mentioned in MDN and other sources TypedArray(length) constructor makes a view of `length` elements not bytes.
It can be also tested by:
```javascript
var x = new Uint32Array(2);
console.log(x.length); //2
x[1] = 25;
console.log(x[1]); //25
@sJJdGG sJJdGG changed the title Update ch5.md Update es6 & beyond - Chapter 5: Collections - TypedArray constructor description Jul 28, 2018
@getify getify force-pushed the master branch 6 times, most recently from 5cb284a to 8af48e2 Compare August 28, 2019 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants