Checks if an array is sorted in descending order.
The input array of numbers.
true if the array is sorted in descending order, otherwise false.
true
false
const sortedArray = [5, 3, 2, 1];const isDescending = isSortedDescending(sortedArray);console.log(isDescending); // Output: true Copy
const sortedArray = [5, 3, 2, 1];const isDescending = isSortedDescending(sortedArray);console.log(isDescending); // Output: true
Checks if an array is sorted in descending order.