- A 2
- B 5
- C 10
- D 24
- Share this MCQ
Answer:
A
Share this MCQ
The /=
operator in JavaScript is an assignment operator that divides the value of the left operand by the value of the right operand and assigns the result to the left operand.
In this case, the variable num
is initially assigned the value 10
, which is a number.
On the second line, num
is divided by 5 using the /=
operator.
The result of the division is 2
, which is then assigned back to num
.
Therefore, num
now has a value of 2
, and when it is logged to the console, the value 2
will be displayed.
Share this MCQ