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

Question about the implicitly-sorted-rule of key #389

Open
navegador5 opened this issue Aug 1, 2024 · 1 comment
Open

Question about the implicitly-sorted-rule of key #389

navegador5 opened this issue Aug 1, 2024 · 1 comment

Comments

@navegador5
Copy link

the document mentioned:

Insertion order of record keys does not affect equality of records, 
because there's no way to observe the original ordering of the keys, as they're implicitly sorted:

what is the sort rule? A or B ?

A. first sort index-like keys : ("1", "15", "6"... ), then others ["aa","bb","cc"]_
B.just sort them together : [1,15, 6, "aa","bb","cc"]

@acutmore
Copy link
Collaborator

acutmore commented Aug 1, 2024

The keys are sorted as strings ("11" < "2" === true). No preference is given to integer index like strings.

1. Let _sortedEntries_ be a new List containing the values of _entries_ sorted such that, for any entry two entries _a_ and _b_, _a_ will be placed before _b_ if the result of performing Abstract Relational Comparison _a_.[[Key]] < _b_.[[Key]] is *true*.

for any entry two entries a and b, a will be placed before b if the result of performing Abstract Relational Comparison a.[[Key]] < b.[[Key]] is true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants