Vidyalelo
JavaScript · Q55

Classes And Modules

Programming · JavaScript · question 55

Q55

Consider the following code snippet [x,y]=[y,x]; What is the result of the above code snippet?

A.
Throws exception
B.
Swap the value of the two variables
C.
Flashes an error
Answer
D.
Creates a new reference object

Answer: Option C

Solution

Answer: Option C
Solution:
The above code snippet swaps the value of the two variables.