80.4k views
2 votes
What will the document.write() statement display, given the following code snippet? var scores = new Array[94, 90, 88, 82, 73, 70, 75]; var lgth = scores.length; document.write("There are " + lgth + "scores recorded. The dropped score is " + scores[lgth – 1]);

User Roullie
by
4.2k points

1 Answer

3 votes

Answer:

There are 7 scores recorded. The dropped score is 75

Step-by-step explanation:

The code snippet above prints through the document.write() function. the output prints the string serving as the argument, and makes use of variables (lgth) and expression also (scores [lgth -1]). what it does is. From the point where it sees +lgth+, it checks the value, which is 7. And when it sees scores [lgth-1] it evaluates it to 75. Hence, the string above is produced.

User Fharreau
by
4.2k points