Tell us what’s happening:
The solution proposed in the hint is not accurate (anymore?) and doesn’t pass the test. The correct answer is:
return arr.sort(function(a,b) {
return a > b ?1:-1;
});
But the solution in the hint is :
return arr.sort(function(a,b) {
return a > b ;
});
which doesn’t sort the array and doesn’t pass the test
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
.
Link to the challenge:
It won’t let me post the link. It’s in Javascript Algorithms And Data Structures Certification (300 hours) -> Functional Programming -> Sort an Array Alphabetically using the sort Method