Slide 18
Slide 18 text
// ΣϒϖʔδଆͷJS
var worker = new Worker(‘task.js’);
worker.addEventListener(‘message’, callback);
worker.postMessage({msg: ‘hello’});
// task.js
self.addEventListener(‘message’, function(e)
{
self.postMessage({msg: e.data.msg});
});