From bd0ef48c655f9a6481ea008b1084bdd9bf499cfa Mon Sep 17 00:00:00 2001 From: Derk-Jan Karrenbeld Date: Thu, 2 Oct 2025 16:19:01 +0200 Subject: [PATCH 1/2] Fix incorrect code fence in introduction.md --- 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 ed6ba23b6a..96850e9ae7 100644 --- a/concepts/template-strings/introduction.md +++ b/concepts/template-strings/introduction.md @@ -41,12 +41,13 @@ 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! 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]. @@ -59,7 +60,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 From 0e746d75ce6a80b3e20110ce0d99de797b20b4cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Oct 2025 14:20:46 +0000 Subject: [PATCH 2/2] [CI] Format code --- 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 96850e9ae7..396c8d8f18 100644 --- a/concepts/template-strings/introduction.md +++ b/concepts/template-strings/introduction.md @@ -42,7 +42,7 @@ 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 -"This is an example of using the newline escape sequence!\nWithout backticks" +'This is an example of using the newline escape sequence!\nWithout backticks'; /* => This is an example of using the newline escape sequence! Without backticks