Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
return function for sort

return (a < b) ? 1 : -1;


a and b can also be undefined

What I have tried:

This is the default return function but it doesn't work in Firefox how to modify it
Posted
Comments
Chris Copeland 28-Nov-22 9:46am    
In what way does "sorting not work in Firefox"? Does it throw an error or are the items not sorted in a way that you expect? If the latter, you need to account for undefined values as part of the function.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900