PrepAway - Latest Free Exam Questions & Answers

You are troubleshooting an application.

You are troubleshooting an application.

Users report that the UI is slow to respond.

You need to improve UI responsiveness by moving application tasks to web workers.

Which two tasks can you move to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. A function that loops through the Document Object Model to update the style of page elements

B. A long-running calculation that requires looping through an array

C. A function that performs graphic-intensive animation

D. A function that stores large amounts of data to local storage

Explanation:

Note:

* Despite the improvements in JavaScript engines, it is not uncommon for users to encounter frozen user interfaces as the browser works throughresource intensive tasks. This leads to a horrible user experience. The purpose of Web Workers is to give developers a way of instructing the browser to process large tasks in the background; therefore preventing the UI from freezing up.

* The Web Workersspecification defines an API for spawning background scripts in your web application. Web Workers allow you to do things like fire up long-running scripts to handle computationally intensive tasks, but without blocking the UI or other scripts to handle user interactions

One Comment on “You are troubleshooting an application.

  1. _mr says:

    B & C seem to be correct.

    * Not A because web workers do not have access to DOM;
    * Not D because web workers do not have access to neither local storage nor session storage.




    0



    0

Leave a Reply