1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-28 21:32:20 +00:00

Merge pull request #532 from waitingsong/arraybuffer

docs: 改进表述
This commit is contained in:
Ruan YiFeng 2017-10-27 13:30:18 +08:00 committed by GitHub
commit 55a79524a6

View File

@ -62,7 +62,7 @@ const dataView = new DataView(buf);
dataView.getUint8(0) // 0 dataView.getUint8(0) // 0
``` ```
上面代码对一段32字节的内存建立`DataView`视图然后以不带符号的8位整数格式读取第一个元素结果得到0因为原始内存的`ArrayBuffer`对象默认所有位都是0。 上面代码对一段32字节的内存建立`DataView`视图然后以不带符号的8位整数格式从偏移0开始读取8bit数据结果得到0因为原始内存的`ArrayBuffer`对象默认所有位都是0。
另一种TypedArray视图`DataView`视图的一个区别是,它不是一个构造函数,而是一组构造函数,代表不同的数据格式。 另一种TypedArray视图`DataView`视图的一个区别是,它不是一个构造函数,而是一组构造函数,代表不同的数据格式。