Hello, I am currently trying to solve the Functional Programming: Sort an Array Alphabetically using the sort Method but it does not want to pass don’t know what is wrong with my code
function alphabeticalOrder(arr) {
function alphabeticalOrder(arr) {
// Add your code below this line
return arr.sort(function(a,b) {
return a > b;
});
}
alphabeticalOrder(["a", "d", "c", "a", "z", "g"]);
yet I passed it with return arr.sort()!
!!
could someone please tell me why!!
Thank you all and happy coding!