exam questions

Exam 98-382 All Questions

View all questions & answers for the 98-382 exam

Exam 98-382 topic 1 question 18 discussion

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

HOTSPOT -
You work as a JavaScript developer for Adventure Works. You are writing a simple script that performs the following actions:
✑ Declares and initializes an array
✑ Fills the array with 10 random integers
✑ Adds every other number starting with the first element
How should you complete the code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
References:
https://www.w3schools.com/jsref/jsref_push.asp
https://www.w3schools.com/js/js_arrays.asp
https://stackoverflow.com/questions/9813573/how-to-perform-a-sum-of-an-int-array

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
ak9797
Highly Voted 4 years, 6 months ago
shouldn't the 3rd dropdown be j+2? because it says every other number
upvoted 15 times
...
KSinha
Highly Voted 5 years, 5 months ago
The last 2 dropdowns will have answers "j+1" and "numbers[j]" respectively. Please recheck and correct those
upvoted 13 times
...
w35l3y
Most Recent 3 years, 11 months ago
[] push j+1 <-- differs from the given answer numbers[j] <-- differs from the given answer
upvoted 2 times
...
PallaviSos
3 years, 11 months ago
correct answers: [ ] push j+2 numbers[j]
upvoted 6 times
...
Zakaaryaaa
4 years ago
the 4th dropdown should be numbers[j]
upvoted 3 times
...
Zakaaryaaa
4 years ago
the 3rd dropdown should be j+2, because there is a ( j = ) before it, so which means j= j+2
upvoted 1 times
...
pleon
4 years, 1 month ago
The correct answers are "[]", "push", "j+1" and numbers[j]
upvoted 4 times
...
bajatot112
4 years, 2 months ago
j+=2 not j+2.
upvoted 2 times
...
kimdo7
4 years, 4 months ago
It is valid but the last once should be numbers[j]
upvoted 3 times
...
GotToo123
4 years, 5 months ago
which one is correct?
upvoted 3 times
...
Ciupaz
4 years, 7 months ago
The 3rd dropdown could be ++j as a valid response, because j++ is wrong.
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 ...