- Open your command-line application and navigate to your workspace.
- Create a new folder named 05-07-reading-shared-buffer-from-multiple-workers.
- Copy or create an index.html that loads and runs a main function from main.js.
- Create a main.js file with an onMessage function that logs out the following members of the message data: workenIndex, type, result, workerIndex, startIndex, endIndex, and windowSize:
// main.jsfunction onMessage(message) {const { type, result, workerIndex, startIndex, endIndex, windowSize } = message.data; console.log(`Result from worker operation { type: ${type}, result: ${result}, workerIndex: ${workerIndex}, startIndex: ${startIndex}, endIndex: ${endIndex}, windowSize: ${windowSize} ...