Skip to content

Conversation

exarus
Copy link
Contributor

@exarus exarus commented Nov 23, 2020

Simplify example for a little bit.

Description of Problem

Array.apply(null, { length: n }) is too hard to understand.

Proposed Solution

Array.from({ length: n }) is much more straightforward in given context. Arrow functions are used in examples, so we can use ES2015. Example is for advanced users, so some complexity is fine. Given the textual context the suggested code is clear enough.

Additional Information

`Array.apply(null, { length: n })` is too hard to understand.
`Array.from({ length: n })` is much more straightforward in given context. Arrow functions are used in examples, so we can use ES2015.
Copy link
Member

@NataliaTepluhina NataliaTepluhina left a comment

Choose a reason for hiding this comment

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

@exarus thank you! Looks good to me 👍🏻

@NataliaTepluhina NataliaTepluhina merged commit 2915212 into vuejs:master Nov 24, 2020
nick-lai pushed a commit to nick-lai/docs-next that referenced this pull request Dec 2, 2020
`Array.apply(null, { length: n })` is too hard to understand.
`Array.from({ length: n })` is much more straightforward in given context. Arrow functions are used in examples, so we can use ES2015.
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.

2 participants