- A Sorts the elements of an array in ascending order
- B Sorts the elements of an array in descending order
- C Sorts the elements of an array in random order
- D None of these
- Share this MCQ
Answer:
A
Share this MCQ
The sort()
function sorts the elements of an array in ascending order.
By default, it compares the elements as strings.
You can pass a comparison function as an argument to sort the elements in a different way.
Share this MCQ