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

Use Template Literals #267

Merged
merged 2 commits into from
Dec 1, 2020
Merged

Conversation

p42-ai[bot]
Copy link
Contributor

@p42-ai p42-ai bot commented Dec 1, 2020

Template literals are string templates that can include variables and expressions. They can replace string concatenation and are often easier to read. Example: `Hello, ${name}!`

This refactoring supports converting the first line of concatenated strings into template literals or shortened strings:

  • concatenated string literals will be combined, e.g. "a" + "b" will become "ab"
  • concatenated expressions and variables will be embedded in templates, e.g. "a" + x + "b" will become `a${x}b`
  • unnecesary escaping of quotes is removed when string are combined or transformed into template literals

P42 and others added 2 commits December 1, 2020 17:37
**Template literals are string templates that can include variables and expressions.** They can replace string concatenation and are often easier to read. Example: `` `Hello, ${name}!` ``

This refactoring supports converting the first line of concatenated strings into template literals or shortened strings:
* concatenated string literals will be combined, e.g. `"a" + "b"` will become `"ab"`
* concatenated expressions and variables will be embedded in templates, e.g. `"a" + x + "b"` will become `` `a${x}b` ``
* unnecesary escaping of quotes is removed when string are combined or transformed into template literals
@domoritz domoritz merged commit 111b907 into master Dec 1, 2020
@domoritz domoritz deleted the p42/b8677f8d-a15e-4cc5-a1b7-f025b4d01bf6 branch December 1, 2020 17:58
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.

1 participant