From the course: JavaScript Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Solution: Create a template literal

Solution: Create a template literal - JavaScript Tutorial

From the course: JavaScript Essential Training

Solution: Create a template literal

(quick music) - [Instructor] To solve this challenge, we'll use template literals to pull information from the new camera object created down here in the test code and then populate it inside this text string here. So the first thing I'll do is try to just pull out one of these pieces of information in my text. If we go up and look at the camera object that will be created, you can see it has different properties, brand, model, year, format, et cetera. And the camera itself sits in this constant my camera. So that means if I go into the backtick here and type in dollar sign, curly brackets, and then say my camera. So that's the object we create down here. And then brand, which is one of the properties, and click test code, I should see an output. Well, the test fails, but I should see the output down here and it is the correct word. So that means we are pulling information from down here up into the code and out into the…

Contents