A

Admin • 833K Points
Coach

Q. 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
  • (D) Creates a new reference object
  • Correct Answer - Option(C)
  • Views: 26
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

The above code snippet swaps the value of the two variables.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.