课程: JavaScript Essential Training
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Solution: Create a content factory
(upbeat music) - [Instructor] There are several ways you can solve this challenge. I'll walk you through the one I think is the most straightforward. It all happens inside the create backpack markup function. This will be our content factory. What we need to do is grab the backpack object array and then iterate through each of the items and generate HTML for the data within each of the items and then somehow return that. And if we look inside create backpack markup right now, you'll notice we're sort of partway there already. We have a constant called content that can contains HTML for our backpack objects, but currently it's just calling one of the backpacks. Then content is returned to our testing function. So I need to change the contents within content to contain all the information for both of the backpacks. And I can do that using the map method. So at the very top here, I'll start out by creating a couple of new…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
-
-
-
-
The real-world function2 分钟 49 秒
-
(已锁定)
Functions and methods6 分钟 23 秒
-
(已锁定)
A standard function3 分钟 53 秒
-
(已锁定)
The arrow function4 分钟 49 秒
-
(已锁定)
Arrow functions and "this"4 分钟 20 秒
-
(已锁定)
Practice: Build a function1 分钟 31 秒
-
(已锁定)
Pass data to a function with parameters4 分钟 56 秒
-
(已锁定)
Return values from a function7 分钟 1 秒
-
(已锁定)
Practice: Pass values between functions2 分钟 33 秒
-
(已锁定)
Callbacks5 分钟 29 秒
-
(已锁定)
Conditional if...else statement5 分钟 52 秒
-
(已锁定)
Logical operators3 分钟 31 秒
-
(已锁定)
Conditional switch statement5 分钟 55 秒
-
(已锁定)
Looping through content5 分钟 19 秒
-
(已锁定)
Using the map() array method4 分钟 52 秒
-
(已锁定)
Challenge intro: Create a content factory2 分钟 36 秒
-
(已锁定)
Solution: Create a content factory5 分钟 21 秒
-
-
-
-