Make sure the Content Security Policy allows access to scripts that have been created on the same origin (eg: this will not work in the gists developer console since script-src is set to assets-cdn.github.com)
function sum(arr) {
return arr.reduce(function(a, b) { return a + b; });
}
var sumWorker = workerFn(sum);
// generate input
for(var input = []; input.length < 1000; input.push(input.length));