exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 4 question 107 discussion

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

You have the following code.

You discover that the displayGlobalProduct function displays a value of boat.
You need to change the function to display a value of car.
Which line of code can you use to replace the alert?

  • A. alert(eval(displayGlobalProduct, ‘product’));
  • B. alert(window.eval(product));
  • C. alert(window.eval(‘product’));
  • D. alert(eval(call(‘product’)));
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
References: http://www.endmemo.com/js/eval.php

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
angela2021
4 years, 5 months ago
i have found this code inside this page: https://stackoverflow.com/questions/3294262/difference-between-window-and-eval-javascript -------------- var foo = "global"; (function () { var foo = "local"; alert(eval("foo")); // alerts "local" alert(window["foo"]); // alerts "global" })();
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 ...