Skip to content
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

[documentation] Float64Array.sort() sorts elements numerically instead of in ASCII character order #45876

Closed
Yonom opened this issue Sep 14, 2021 · 0 comments Β· Fixed by #45883
Closed
Labels
Bug A bug in TypeScript Docs The issue relates to how you learn TypeScript Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Milestone

Comments

@Yonom
Copy link

Yonom commented Sep 14, 2021

Bug Report

πŸ”Ž Search Terms

Float64Array TypedArray Float32Array documentation sort ascii typescript

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about documentation

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

new Float64Array([1000, 1, 2]).sort()

// documentation on Float64Array.sort(): If [compareFn is] omitted, the elements are sorted in ascending, ASCII character order.

// expected as per docs
// [1, 1000, 2]

// actual
// [1, 2, 1000]

πŸ™ Actual behavior

The code behaves differently than the documentation states it. The elements are sorted numerically and not by ASCII character order.

πŸ™‚ Expected behavior

I expected the documentation to match with the actual behavior.

@andrewbranch andrewbranch added Bug A bug in TypeScript Docs The issue relates to how you learn TypeScript Good First Issue Well scoped, documented and has the green light Help Wanted You can do this labels Sep 14, 2021
@andrewbranch andrewbranch added this to the Backlog milestone Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Docs The issue relates to how you learn TypeScript Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants