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

Append ES2019 flat() version #187

Merged
merged 2 commits into from
May 6, 2019

Conversation

terrierscript
Copy link
Member

I found flatten and flattenDeep can replace with flat() function.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat

It's so edge function, and I not remove reduce version.

@coveralls
Copy link

coveralls commented May 3, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling dfd4a3d on terrierscript:es2019-flat into f351692 on you-dont-need:master.

@@ -455,6 +455,9 @@ Flattens array a single level deep.
const flatten = [1, [2, [3, [4]], 5]].reduce( (a, b) => a.concat(b), [])
// => [1, 2, [3, [4]], 5]

// Native(ES2019)
const flatten = [1, [2, [3, [4]], 5]].flat()
// => [1, 2, [3, [4]], 5]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add please support table for Array​.prototype​.flat()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I append it

Copy link
Member

@stevemao stevemao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@stevemao stevemao merged commit c102321 into you-dont-need:master May 6, 2019
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

Successfully merging this pull request may close these issues.

None yet

4 participants