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

Clarify template string example #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Clarify template string example
Removes the possible confusion that `\n` is displayed *literally*.
Fixes typo "not legal" -> "now legal" and clarify that this applies in
template strings in ES6.
  • Loading branch information
Lekensteyn committed Nov 7, 2015
commit 92239c354f59d27c87fe2b3c2f318456d591eb5e
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ Template strings provide syntactic sugar for constructing strings. This is simi

```JavaScript
// Basic literal string creation
`In JavaScript '\n' is a line-feed.`
`In JavaScript '\n' is a line-feed.` === "In JavaScript '\n' is a line-feed."

// Multiline strings
`In JavaScript this is
not legal.`
`In ES6 this line break is
now legal.` === "In ES6 this line break is\n now legal."

// String interpolation
var name = "Bob", time = "today";
Expand Down