exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 2 question 47 discussion

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

DRAG DROP -
You have the following code:

The web service returns a JSON object that contains two properties named Description and FileName.
The PersonImage object must meet the following requirements:
✑ Create an object that represents an image that will be displayed.
✑ Set the image properties from the values that are returned by the web service.
✑ Expose the image as a property of the PersonImage object.
You need to insert code at line 13 to complete the implementation of the PersonImage object.
Which three actions should you perform in sequence to complete the implementation? (Develop the solution by selecting the required code segments and arranging them in the correct order.)
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Note:
* Image Object
The Image object represents an embedded image.
For each <img> tag in an HTML document, an Image object is created.
Notice that images are not technically inserted into an HTML page, images are linked to HTML pages. The <img> tag creates a holding space for the referenced image.
* Image Object Properties include
alt, Sets or returns the value of the alt attribute of an image src, Sets or returns the value of the src attribute of an image

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
MrEngineer
Highly Voted 5 years, 6 months ago
should be "this.img=img;" instead of "return this.img;"
upvoted 12 times
KyryIx
5 years, 4 months ago
It's correct your answer, because "Expose the image as a property of the PersonImage object."
upvoted 3 times
stef1
5 years, 2 months ago
I totally agree. In fact, two more things are wrong with the 3rd answer box: PersonImage is a constructor - so it shouldn't have a return value. Instead - it should set the properties of an object instance - and for that you use a syntax this.[propName] = val; In this case, img is an internal variable (var img...) - but its value is NOT being used, just being set. By doing this.img = img , we are setting the object property to that internal variable. And that's exactly what's needed here.
upvoted 2 times
...
...
...
alexcode
Most Recent 4 years, 7 months ago
Correct answer–> this.img = img In last
upvoted 1 times
...
ruif90
4 years, 10 months ago
I don't get it. Shouldn't we do this.img = img before the return?
upvoted 1 times
...
bdb1993
5 years, 7 months ago
var img should be this.img
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 ...