From d8bc02a7c93ba75c6bbfe2e9786c66ec15fdb1e4 Mon Sep 17 00:00:00 2001 From: Adebiyi Itunuayo <44436048+FFFF-0000h@users.noreply.github.com> Date: Wed, 1 Oct 2025 21:42:25 +0100 Subject: [PATCH 1/4] 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..bec60cd1e7 100644 --- a/concepts/template-strings/introduction.md +++ b/concepts/template-strings/introduction.md @@ -32,7 +32,20 @@ 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 +"This is an example of using the newline escape sequence!\nWithout backticks" + +/* => This is an example of using the newline escape sequence! + Without backticks +*/ With the available substitution capabilities, you can also introduce logic into the process to determine what the output string should be. One way to handle the logic could be using the [ternary operator][ternary-operator]. From da35f6a9c7ce8fe2927561c9932177ba9fc22096 Mon Sep 17 00:00:00 2001 From: Adebiyi Itunuayo <44436048+FFFF-0000h@users.noreply.github.com> Date: Wed, 1 Oct 2025 21:45:09 +0100 Subject: [PATCH 2/4] Update instructions.md --- exercises/concept/custom-signs/.docs/instructions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exercises/concept/custom-signs/.docs/instructions.md b/exercises/concept/custom-signs/.docs/instructions.md index 3a8a659d6f..e4ccb0ba46 100644 --- a/exercises/concept/custom-signs/.docs/instructions.md +++ b/exercises/concept/custom-signs/.docs/instructions.md @@ -32,7 +32,9 @@ Implement the function `graduationFor(name, year)` which takes a name as a strin ```javascript graduationFor('Hannah', 2022); -// => "Congratulations Hannah!\nClass of 2022" +/* => "Congratulations Hannah! + Class of 2022" +*/ ``` ## 4. Compute the cost of a sign From 7fa929947d00248f39e329d3610106b97986ed62 Mon Sep 17 00:00:00 2001 From: Adebiyi Itunuayo <44436048+FFFF-0000h@users.noreply.github.com> Date: Thu, 2 Oct 2025 00:26:14 +0100 Subject: [PATCH 3/4] Update concepts/template-strings/introduction.md Co-authored-by: Derk-Jan Karrenbeld --- concepts/template-strings/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concepts/template-strings/introduction.md b/concepts/template-strings/introduction.md index bec60cd1e7..5c80de6b66 100644 --- a/concepts/template-strings/introduction.md +++ b/concepts/template-strings/introduction.md @@ -38,7 +38,7 @@ lines`; lines */ ``` -If you want to represent a newline inside a single-line string (not using backticks), you can use the newline escape sequence `\n`: +If you want to represent a newline inside a regular string instead of using a template string (ie. not using backticks), you can use the newline escape sequence `\n`: ```javascript "This is an example of using the newline escape sequence!\nWithout backticks" From 6c5b0b39874e9aed90fa076e6c5ddcfb0b1f1ba6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Oct 2025 06:16:27 +0000 Subject: [PATCH 4/4] [CI] Format code --- concepts/template-strings/introduction.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/concepts/template-strings/introduction.md b/concepts/template-strings/introduction.md index 5c80de6b66..ed6ba23b6a 100644 --- a/concepts/template-strings/introduction.md +++ b/concepts/template-strings/introduction.md @@ -38,9 +38,10 @@ lines`; lines */ ``` + If you want to represent a newline inside a regular string instead of using a template string (ie. not using backticks), you can use the newline escape sequence `\n`: -```javascript +````javascript "This is an example of using the newline escape sequence!\nWithout backticks" /* => This is an example of using the newline escape sequence! @@ -58,7 +59,7 @@ const grade = 95; `You have ${grade > 90 ? 'passed' : 'failed'} the exam.`; // => You have passed the exam. -``` +```` [string-reference]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String [type-conversion-concept]: /tracks/javascript/concepts/type-conversion