function fibonacci(n) {
return n<=2?1:fibonacci(n-1)+fibonacci(n-2)
}
var onmessage=function (event) {
var number=event.data;
console.log('分线程接受到数据:'+number)
//计算
var result=fibonacci(number)
//向主线程发送数据
postMessage(result)
console.log('分线程向主线程发送数据'+result);
}