Skip to content

Migrate from string addition to template literals#504

Draft
j0lol wants to merge 3 commits intocodebar:gh-pagesfrom
j0lol:feat/es6-migration/template-literals
Draft

Migrate from string addition to template literals#504
j0lol wants to merge 3 commits intocodebar:gh-pagesfrom
j0lol:feat/es6-migration/template-literals

Conversation

@j0lol
Copy link

@j0lol j0lol commented Mar 18, 2026

(This is a draft, it is based on a previous PR #503 and will not be able to be merged without the previous one)

Another ES6 feature is template literals (MDN), which are strings that are denoted with backticks (`) instead of quotes. These allow for string interpolation like this:

let foo = `Hello ${name}!`;

I have added an explainer to Lesson 1 and replaced (hopefully) all uses of string additon ("Hello" + name) with template literals. I'm hoping this syntax is clearer to beginners (what is a string plus a number? number plus a string?)

@j0lol j0lol force-pushed the feat/es6-migration/template-literals branch from eb40e5d to fbd9b9d Compare March 18, 2026 09:08
j0lol and others added 2 commits March 18, 2026 11:30
Co-authored-by: Burhan Ali <1482649+biggianteye@users.noreply.github.com>
Yes reviewers, ` \`\` \` \`\` ` is the only way
to put backticks in backtics in Jekyll. I tried \
@j0lol j0lol force-pushed the feat/es6-migration/template-literals branch from fbd9b9d to a873f2b Compare March 18, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant