Loading topic
0xff. You will see Uint8Array used briefly to look inside a buffer. The next chapter covers typed arrays pro4 min readArrayBuffer holds bytes, but it gives you no way to read or change them. To work with those bytes you need a view. A typed array is a view that treats a region of a buffer as a list of numbers that all have the same type. This chapter covers how views relate to the buffer underneath them, the w6 min readArrayBuffer and wrap it in a typed array, as covered in the previous two chapters. It also assumes you know the difference between integers and floating-point numbers, and that you can read hexadecimal.5 min readArrayBuffer is a fixed block of raw bytes. A typed array is a view that reads and writes those bytes as numbers. Each element type has a fixed size, such as 1 byte for Uint8Array and 4 bytes for Uint32Array. This chap5 min readArrayBuffer, and how several views can share one buffer. You should also be comfortable reading hexadecimal values such as 0x1234. Here you will learn why a multi-byte number can be stored in memory in two different ways, 5 min readTextEncoder and TextDecoder, and covers the edge5 min readasync/await and fetch, and that you know the earlier material: an ArrayBuffer holds raw bytes, and a typed array or DataView reads them. So far every buffer in this tutorial was created by hand with new ArrayBuffer(n). Real programs get their bytes from s4 min readsubarray versus slice, and TextDecoder. You should be comfortable writing a class in JavaScript and reading a try/catch block. Here those pieces come together: you will design a small binary file format, write a4 min readbyteOffset alignment works, and how DataView handles byte order. You should also know the basics of JavaScript's BigInt type: literals such as 10n, and the rule that you cannot mix BigInt and Number in arith4 min readArrayBuffer, wrap it in typed arrays and a DataView, and set a view's byteOffset and length. Everything here comes from ES2024. Current browsers and Node.js 22 support it. Older runtimes may support resizing but not transfer, so check before y4 min readArrayBuffer and typed array views work, including how several views can share one buffer. It also assumes you know the basics of Web Workers or Node's worker_threads: a worker runs code on another thread and talks to the main thread only through messages. The pr5 min readpostMessage. You should also know how to start a worker, either a browser Worker or Node.js worker_threads. The examples are written for Node.js, so you can run them 5 min read