From the course: JavaScript Essential Training
Unlock the full course today
Join today to access over 23,400 courses taught by industry experts.
Challenge intro: Create a template literal - JavaScript Tutorial
From the course: JavaScript Essential Training
Challenge intro: Create a template literal
(light upbeat music) - [Instructor] Template literals are both useful and in heavy use across JavaScript applications, so in this challenge, you'll create a new template literal to output information from an object as a String. Your starting code contains a constructor for the Camera object, capturing information about cameras, and a function, cameraAge, to calculate the age of the camera based on the information in one of the Camera objects. The test code has a constant, myCamera, using the Camera object constructor to create a new object. Your task in this challenge is to add a template literal to the cameraStory constant matching this formatting, populated with the data from the myCamera object. These instructions may make more sense when you see them in context. In the answer code for this challenge, you'll find the object constructor, Camera, that receives all the information about the camera. There's a function…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.