Skip to content

Commit 04464c5

Browse files
authored
Update introduction.md
1 parent a5bd153 commit 04464c5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

concepts/template-strings/introduction.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ When you are needing to have strings formatted on multiple lines:
3232
`This is an example of using template
3333
strings to accomplish multiple
3434
lines`;
35+
36+
/* => This is an example of using template
37+
strings to accomplish multiple
38+
lines
39+
*/
40+
```
41+
If you want to represent a newline inside a single-line string (not using backticks), you can use the newline escape sequence `\n`:
42+
```javascript
43+
"Congratulations Hannah!\nClass of 2022"
44+
45+
/* => Congratulations Hannah!
46+
Class of 2022
47+
*/
3548
```
3649

3750
With the available substitution capabilities, you can also introduce logic into the process to determine what the output string should be.

0 commit comments

Comments
 (0)