worker.setEnvironmentData(key[, value])
key<any> 任何任意的、可克隆的 JavaScript 值,都可以用作 <Map> 键。value<any> 任何任意的、可克隆的 JavaScript 值,该值将被克隆并自动传递给所有新的Worker实例。如果value作为undefined传递,之前为key设置的任何值都将被删除。
worker.setEnvironmentData() API 设置当前线程以及从当前上下文生成的所有新 Worker 实例中 worker.getEnvironmentData() 的内容。
🌐 The worker.setEnvironmentData() API sets the content of
worker.getEnvironmentData() in the current thread and all new Worker
instances spawned from the current context.