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

getDataGroupBy.js output is uncertain. #3

Open
hiyangguo opened this issue Jul 30, 2018 · 0 comments
Open

getDataGroupBy.js output is uncertain. #3

hiyangguo opened this issue Jul 30, 2018 · 0 comments

Comments

@hiyangguo
Copy link
Member

return Object.entries(tempData).map(item => ({

In the ECMAScript 2017 (ECMA-262) the part of Object.entries().
If key type is Number ,it will sort in ascending order.
eg:

Object.entries({2:'test1',1:'test2'});

image

But key type is String,it will be sorted in the order in which they are declared.
eg:

Object.entries({a:'test1',b:'test2'});

image

so if my group value type is number ,it will sort in ascending order.

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

1 participant