const { parentPort, workerData } = require('worker_threads'); const { determinant } = require('./matrix.operations'); const partialDet = workerData.reduce((acc, job) => { return acc + job.value * determinant(job.minor) * job.sign; }, 0); parentPort.postMessage(partialDet);