A

Admin • 833K Points
Coach

Q. Consider the following code snippet
data.sort(function(a,b),b-a);
What does the above code do?

  • (A) Sort in the alphabetical order
  • (B) Sort in the chronological order
  • (C) Sort in reverse alphabetical order
  • (D) Sort in reverse numerical order
  • Correct Answer - Option(D)
  • Views: 18
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

The above code snippet sorts an array in reverse numerical order.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.