4 ms·
To a limited capacity. If you're looking for: console.log('this is in the document'); go(function() { console.log('this is in a web worker'); }); I'd reco
by pfraze 13y ago
To a limited capacity. If you're looking for:
console.log('this is in the document');
go(function() { console.log('this is in a web worker'); });
I'd recommend against it. Even if you can toString() the function passed to go() and load that into a worker, you'd not carry the function's closure, which I think is too complex.
var x = 5;
go(function() { console.log('x = '+x); });
// => x = undefined
Could be done, but I'd rather stick with paradigms that fit the language more closely.