exam questions

Exam 98-382 All Questions

View all questions & answers for the 98-382 exam

Exam 98-382 topic 1 question 12 discussion

Actual exam question from Microsoft's 98-382
Question #: 12
Topic #: 1
[All 98-382 Questions]

HOTSPOT -
You evaluate the following code:

You need to determine the values of sampleStudent, sampleCourse.name, and sampleCourse.grade that are output by console.log().
What are the final values for the three variables? To answer, select the appropriate values in the answer area.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
References: https://www.w3schools.com/js/js_output.asp

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
becky_intelletive
Highly Voted 4 years, 5 months ago
This one is actually correct: https://codepen.io/becky-intelletive/pen/wvzNxOr (I added some html to illustrate the result) In summary: the change() function gets references to the sampleStudent and sampleCourse. For the student, it updates the reference, thus preserving the original in its original state ("HTML student"). For the course, we aren't updating the reference. We're using the reference to access the object's keys. Since they are the "real" keys and not references to the keys, we are therefore updating their "real" values. The original values thus get overwritten.
upvoted 8 times
learning_weber
4 years, 5 months ago
this means the given answer is correct?
upvoted 7 times
...
...
d31a
Most Recent 2 years, 4 months ago
The correct answer is: HTML Student, JavaScript, 100. Why? Because you are only updating the 'course' name, not the property values. To update the proerty values you would have to call them: console.log(sampleStudent, sampleCourse.name = "html", sampleCourse.grade = "90");
upvoted 1 times
...
Sathya235
3 years, 5 months ago
HTML Student JavaScript 100
upvoted 2 times
...
PallaviSos
3 years, 12 months ago
Correct answers : HTML Student, JavaScript ,100
upvoted 3 times
...
nathalias
4 years ago
Only the values of the object (sampleCourse) will be changed.
upvoted 2 times
...
Njokingcodes
4 years, 3 months ago
It's correct. It would change if it was sampleStudent.student
upvoted 2 times
...
randallitoooo
4 years, 3 months ago
Las respuestas estan correcta.SampleCourse al ser un objeto,esta asignando el valor por referencia.
upvoted 1 times
...
CodeMan
4 years, 6 months ago
The only correct answer in this solution is the grade. Student = 'JavaScript Student' & Course = 'JavaScript'. I'm beginning to believe each one of these solutions is incorrect.
upvoted 1 times
...
coder1234566777
4 years, 7 months ago
sampleStudent is Javascript Student, not HTML Student
upvoted 2 times
kimdo7
4 years, 4 months ago
sampleStudent is HTML because the parameter was passed as string not referenced
upvoted 4 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 ...