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

Example in 8.2 confusing #2071

Closed
Dreamsorcerer opened this issue Aug 14, 2019 · 1 comment
Closed

Example in 8.2 confusing #2071

Dreamsorcerer opened this issue Aug 14, 2019 · 1 comment
Assignees

Comments

@Dreamsorcerer
Copy link

I can't understand the examples given in section 8.2:

// bad
[1, 2, 3].map((number) => `A string containing the ${number}.`);

// good
[1, 2, 3].map((number) => `A string containing the ${number + 1}.`);

Why is the first bad, and the second good? Neither have side-effects, so surely both are good?

@ljharb
Copy link
Collaborator

ljharb commented Aug 14, 2019

That looks to have mistakenly added in 820745d#diff-04c6e90faac2675aa89e2176d2eec7d8R963-R965 / #1863, probably a bad rebase. I'll clean it up.

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

No branches or pull requests

2 participants