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
πŸ’¬ Discuss
βœ… Correct Answer: (D) Sort in reverse numerical order
Explanation: The above code snippet sorts an array in reverse numerical order.
Explanation by: Mr. Dubey
The above code snippet sorts an array in reverse numerical order.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
251
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
92%
Success Rate