en.javascript.info/6-binary/01-arraybuffer-and-views/01-concat/_js.view/source.js
2019-03-17 20:05:02 +03:00

13 lines
286 B
JavaScript

function concat(arrays) {
// ...your code...
}
let chunks = [
new Uint8Array([0, 1, 2]),
new Uint8Array([3, 4, 5]),
new Uint8Array([6, 7, 8])
];
console.log(Array.from(concat(chunks))); // 0, 1, 2, 3, 4, 5, 6, 7, 8
console.log(concat(chunks).constructor.name); // Uint8Array