98-382 Exam QuestionsBrowse all questions from this exam

98-382 Exam - Question 18


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:

Exam 98-382 Question 18
Show Answer
Correct Answer:
Exam 98-382 Question 18

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

Discussion

11 comments
Sign in to comment
ak9797
Nov 17, 2020

shouldn't the 3rd dropdown be j+2? because it says every other number

KSinha
Dec 31, 2019

The last 2 dropdowns will have answers "j+1" and "numbers[j]" respectively. Please recheck and correct those

PallaviSos
Jul 4, 2021

correct answers: [ ] push j+2 numbers[j]

pleon
Apr 29, 2021

The correct answers are "[]", "push", "j+1" and numbers[j]

GotToo123
Dec 21, 2020

which one is correct?

kimdo7
Feb 5, 2021

It is valid but the last once should be numbers[j]

Zakaaryaaa
Jun 7, 2021

the 4th dropdown should be numbers[j]

bajatot112
Mar 11, 2021

j+=2 not j+2.

w35l3y
Jul 4, 2021

[] push j+1 <-- differs from the given answer numbers[j] <-- differs from the given answer

Ciupaz
Oct 14, 2020

The 3rd dropdown could be ++j as a valid response, because j++ is wrong.

Zakaaryaaa
Jun 7, 2021

the 3rd dropdown should be j+2, because there is a ( j = ) before it, so which means j= j+2