-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
orderBy not working with null values #69
Comments
This is the function used for comparison:
Values are reversed if
One solution would be to pass a better lambda to
|
Thank you for your quick reply. Do you intend to change the library to better handle nulls like in this case? Or is the workaround you posted going to be the permanent solution? |
Not sure yet... https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort We can probably do the same for this library using some |
Gotcha. It's a fairly common use case for us ( e.g. calling We were surprised that the order returned was not the same as when doing the equivalent calls in C# LINQ. C# will return the expected output I listed earlier. |
|
Now , you can set compare function , at 3.2.2
output: You can prepare a custorm compare function to let null in front. |
warning:You should have a reasonable initialization parameter,otherwise the result may not be what you want. Example:
|
We're getting some really weird behavior when using
orderBy
on arrays withnull
in them.Below is a test case running linq 3.2.1 on node 10.15.3.
Expected output:
Actual output:
Thanks in advance for any help you can provide.
The text was updated successfully, but these errors were encountered: