1.

How can you send data using a Worker object?(a) postMessage()(b) sendMessage()(c) Message()(d) post()I have been asked this question in examination.My question is based upon Web Workers in portion Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (a) POSTMESSAGE()

The best I can explain: Once you have a Worker object, you can SEND data to it with postMessage(). The value you pass to postMessage() will be cloned, and the resulting COPY will be delivered to the worker via a message event. postMessage() sends a message — which can CONSIST of any JavaScript object — to the worker’s inner scope.



Discussion

No Comment Found

Related InterviewSolutions