From the course: JavaScript Essential Training

Unlock the full course today

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

Challenge intro: Create a content factory

Challenge intro: Create a content factory - JavaScript Tutorial

From the course: JavaScript Essential Training

Challenge intro: Create a content factory

(upbeat music) - [Instructor] When you build websites and applications, you'll often use JavaScript to pull data from a source in the form of structured objects and then use the data within those objects to populate HTML to be displayed in the browser. This challenge lets you experiment with this scenario by creating a content factory function. In the answer code for the challenge here, you have a lot of stuff going on, so let's break it down from the top. First, we have a backpack constructor class that creates our backpack, and it also sets up this backpack age function that allows us to find out how old the backpack is. Then two backpacks are defined, one called everydayPack and one called frogPack, and down here, we have a constant with a backpack object array that contains the everydayPack object and the frogPack object. All of this creates the type of array structure that you normally encounter when you work…

Contents