From 04464c5a512fcd1c30956d7e1cd9d4ee380beb04 Mon Sep 17 00:00:00 2001 From: Adebiyi Itunuayo <44436048+FFFF-0000h@users.noreply.github.com> Date: Wed, 1 Oct 2025 20:54:08 +0100 Subject: [PATCH] Update introduction.md --- concepts/template-strings/introduction.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/concepts/template-strings/introduction.md b/concepts/template-strings/introduction.md index 7e54dc9cf9..8ab158b98a 100644 --- a/concepts/template-strings/introduction.md +++ b/concepts/template-strings/introduction.md @@ -32,6 +32,19 @@ When you are needing to have strings formatted on multiple lines: `This is an example of using template strings to accomplish multiple lines`; + +/* => This is an example of using template + strings to accomplish multiple + lines +*/ +``` +If you want to represent a newline inside a single-line string (not using backticks), you can use the newline escape sequence `\n`: +```javascript +"Congratulations Hannah!\nClass of 2022" + +/* => Congratulations Hannah! + Class of 2022 +*/ ``` With the available substitution capabilities, you can also introduce logic into the process to determine what the output string should be.