Answer: If we need to execute a JavaScript file asynchronously and autonomously, we need to take help of Web Workers API. It is a thread that executes a java-script file.It helps to achieve multi threading in web application.
e.g. var worker = new Worker("http://xyz.com/somejsfile.js");
The above code will execute the
somejsfile.js - javascript file that has been passed inside the Worker() method.
Asked In: Many Interviews |
Alert Moderator