mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2024-04-21 12:32:22 +00:00
docs(ArrayBuffer): add conversion demos
This commit is contained in:
@@ -273,6 +273,10 @@ const typedArray = new Uint8Array([1, 2, 3, 4]);
|
||||
TypedArray数组也可以转换回普通数组。
|
||||
|
||||
```javascript
|
||||
const normalArray = [...typedArray];
|
||||
// or
|
||||
const normalArray = Array.from(typedArray);
|
||||
// or
|
||||
const normalArray = Array.prototype.slice.call(typedArray);
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user