This course will be retired on October 31, 2026.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Introducing ES2015!
You have completed Introducing ES2015!
Preview
Concatenating strings in JavaScript has lead to a lot of confusion. With Template Strings we can safely construct strings with ease.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
We have relied on the plus operator to
add variable values and strings together.
0:00
It's not a very elegant solution.
0:03
Thankfully ES 2015 provides a really neat
syntax that lets us mix string literals,
0:05
variables, and expressions but
before we look at this new syntax
0:10
let's look at some of the ways
to create strings in ES5.
0:14
If you're following along, go ahead and
open the workspace for this video.
0:18
In the file simple-string.js,
I have a variable named str or
0:22
string and I simply log into the console.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up