课程: JavaScript Essential Training

今天就学习课程吧!

今天就开通帐号,24,600 门业界名师课程任您挑!

Solution: Create a template literal

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…

内容