HTML5 Web Workers - MCQs

HTML5 Web Workers - MCQs


1) Web Workers don't stop by themselves but the page that started them can stop them by calling terminate() method.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




2) JavaScript was designed to run in a single-threaded environment, meaning multiple scripts cannot run at the same time.

A) Yes
B) No
View Answer / Hide Answer

ANSWER: A) Yes




3) Which is a JavaScript running in the background, without affecting the performance of the page.

A) Web Worker
B) Canvas
C) SVG
D) None of the above
View Answer / Hide Answer

ANSWER: A) Web Worker




4) Since web workers are in external files, they do not have access to which of these JavaScript objects.

A) The window object
B) The document object
C) The parent object
D) All the mentioned above
View Answer / Hide Answer

ANSWER: D) All the mentioned above




5) To reuse the web worker which code is used.

A) w.terminate();
B) w = undefined;
C) w = terminate;
D) w.undefined();
View Answer / Hide Answer

ANSWER: B) w = undefined;




6) The following lines checks if the worker already exists, if not - it creates a new web worker object and runs the code for.
"demo_workers.js":

if(typeof(w) == "undefined") {
w = new Worker("demo_workers.js");
}

A) Creating a web worker support
B) Creating a Web worker file
C) Creating a web worker object
D) None of the above
View Answer / Hide Answer

ANSWER: C) Creating a web worker object




7) When executing scripts in an HTML page, the page becomes responsive until the script is finished.

A) True
B) False
View Answer / Hide Answer

ANSWER: B) False


Post your comment