0 votes
in JavaScript by (19.8k points)
Which of the following options would be the correct output for the given JavaScript code?

var x=0;  



a) 10

b) error

c) 4

d) 5

1 Answer

0 votes
by (23.1k points)

Answer: A

Reason: The variable's value will increase until it gets equal to 10, then the control will exit the loop's definition. There are no other statements to be executed in the definition of the loop,only the value of the variable "x" will be incremented, and the output will be 10.

Related questions