About web worker api

in web worker api , when i run it then “timeout

” is telling undefined error​

there is no such function in the code


both are complete different


another error not related to above that

setTimeout("myfunc()", 500) // function name is string its wrong 
setTimeout(myfunc(), 500) // function name with () is wrong , its used it execute function
setTimeout(myfunc, 500) // is correct