Skip to content

Example in 8.2 confusing #2071

Closed
Closed
@Dreamsorcerer

Description

@Dreamsorcerer

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?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions