JavaScript: The Recent Parts

Tagged Template Exercise

Kyle Simpson

Kyle Simpson

You Don't Know JS
JavaScript: The Recent Parts

Check out a free preview of the full JavaScript: The Recent Parts course

The "Tagged Template Exercise" Lesson is part of the full, JavaScript: The Recent Parts course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to utilize both template strings, and tagged templates in a statement that is logged in the console.

Preview
Close

Transcript from the "Tagged Template Exercise" Lesson

[00:00:00]
>> Kyle Simpson: All right, let's try to work on an exercise about these so called template literals or interval literals, how we are on to refer to them. And specifically, we're going to work with tagged interpret literals. So, here's you're going to be building your own tag function. You'll see that it's called upper and you're gonna be using upper to make sure that a string drops in these three variables, the name, twitter and topic as you see here.

[00:00:28]
But the purpose of upper is not just to combine the string but to upper case the values only. So you can see that your console.log statement here should end up printing true because your string should end up equaling the string that you see there. So in effect, that is your test case, make sure the console.log prints true.

[00:00:47]
Define your upper tag function and then make sure to tag that interval literal and drop in the expressions as you saw in the lecture. So we'll come back in a couple of minutes and talk through the solution, if you get stuck on this, feel free to always take a look at the solution file in ex.fixed.js

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now