As mentioned previously, SharedArrayBuffer is not copied between threads. It is shared. So, when we create the shared array buffer and pass that reference to a worker, the values inserted into the array by the main thread are available in the worker.
After the worker receives messages to perform calculations, the values can be accumulated as they were in any other array, and the value sent back is a simple message.