Now that we know how to create and use a SharedArrayBuffer, we can use one to share data between the main thread and workers. As mentioned previously, this has an advantage over posting JavaScript objects, in that the data doesn't need to be copied; it is shared.
In this recipe, we'll see how to share a SharedArrayBuffer with a worker, and post the result back to the main thread.