Which will be invoked to create a new worker?

Which will be invoked to create a new worker?
A. Function
B. Destructor
C. Constructor
D. Interface
 
Answer: c
Explanation: When executing scripts in an HTML page, the page becomes unresponsive until the script is finished. To create a new worker, just use the Worker() constructor, passing a URL that specifies the JavaScript code that the worker is to run :
Code:
var loader = new Worker("utils/loader.js");
 

Tìm kiếm

Back
Top