KIRUPA ๐ŸŠ
KIRUPA ๐ŸŠ
HomeArchiveLeaderboardAbout
Sign in

Combining strings made simple...literally! ๐Ÿš€

String Literals to the Rescue!

KIRUPA ๐ŸŠ's avatar
KIRUPA ๐ŸŠ
Apr 24

Combining strings in JavaScript has always been a bit messy. It involves a lot of quotation marks and plus signs, and it was almost always an exercise in trial and error:

When you ran the code, the spacing may be off. You forgot to close a quotation mark, so the entire output would look funky. If there is a line break, wellโ€ฆyou had to Google to see what to do. If you havenโ€™t lived through some of the chaos, you get the idea.

To help us solve this, we now have string literals:

String literals bring a lot of clarity by giving us a simple syntax optimized for generating our final string and marking the content we want to substitute by using the weirdly friendly $ and { } bracket syntax.

To learn more, check out my latest article on the site, appropriately (and very boringly) called Combining Strings and Variables. I walk through the traditional approach and the string literal approach along with some additional tidbits of information along the way.

Video Version

I have been creating videos of some of my more popular articles, such as this one. Check out the video version of our combining strings problem below:

Combining Strings and Variables

There are a bunch of other videos on web development topics that you can find on this siteโ€™s Youtube channel, so head on over and subscribe if you havenโ€™t.

Arrays: The Book

If you are looking for a fun and easy-to-follow guide to learn about Arrays in JavaScript, look no further!

Learn More

Till Next Time

All right! This marks another installment of our pithy newsletter on web development topics. If you ever have ideas for topics youโ€™d like me to consider writing about or just want to chat about anything web development related, drop by the forumsโ€ฆjust like it is 1999!

Oh, and follow me on Twitter as well. Youโ€™ll thank me one day.

Website icon

View this email in your browser

Copyright (C) *|CURRENT_YEAR|* *|LIST:COMPANY|*. All rights reserved.

*|IFNOT:ARCHIVE_PAGE|**|LIST:DESCRIPTION|**|END:IF|*

*|IFNOT:ARCHIVE_PAGE|**|HTML:LIST_ADDRESS_HTML|**|END:IF|*

Update Preferences | Unsubscribe

*|IF:REWARDS|* *|HTML:REWARDS|* *|END:IF|*

Discussion about this post

User's avatar

Keep reading

KIRUPA ๐ŸŠ

Thought provoking and educational content that lives at the intersection of design ๐ŸŽจ, development ๐Ÿค–, and business ๐Ÿ’ฐ.

  • About
  • Archive
  • Recommendations
  • Sitemap
ยฉ 2026 KIRUPA ๐ŸŠ ยท Privacy โˆ™ Terms โˆ™ Collection notice
Start your SubstackGet the app
Substack is the home for writing, podcasting, and media founders.