Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following JavaScript code?
[x,y]=[y,x];

What will be the output of the following JavaScript code?
[x,y]=[y,x];
a) Throws exception
b) Swap the value of the two variables
c) Flashes an error
d) Creates a new reference object

Answer: c
Explanation: The above code snippet will flash an error message. This is due to the fact that the variables x and y are not defined.

Join The Discussion