exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 3 question 37 discussion

Actual exam question from Microsoft's 70-480
Question #: 37
Topic #: 3
[All 70-480 Questions]

DRAG DROP -
You are implementing a web worker by using JavaScript and HTML5. The web worker processes a long-running loop and returns the result to a webpage.
The web worker is defined on the webpage as follows:

You have the following requirements:
✑ Evaluate the message value in the web worker.
✑ Process the loop based on the iterations value that is passed from the webpage.
✑ Return a value back to the webpage from the web worker.
You need to implement the web worker.
How should you complete the relevant code? (To answer, drag the appropriate code segment to the correct location or locations in the answer area. Use only code segments that apply.)
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Note:
* The event object for a message event supports the following additional properties: the data property contains the message, the origin property retrieves the scheme, hostname and port of the document that invoked the postMessage method, the source property refers to the window object that contains the document that invoked the postMessage method, the lastEventId property returns the identifier of the last message.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
notGlutton
4 years, 9 months ago
Not out of scope. var is not limited by block scope, in the way that let is. So the var returnValue would exist at the function scope level.
upvoted 1 times
...
Kaine
5 years ago
Isn't returnValue out for scope at the end?
upvoted 1 times
Mere
4 years, 11 months ago
I confirm. ReturnValue is out of scope.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...