Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
The Build an Object Challenge, Part 21:23 with Dave McFarland
Create a program that runs through an array of student information and prints out data specific to each student.
Now that we have a working data structure, holding student records, 0:00 it's time to print that information to the page. 0:04 For this part of the challenge, you need to access each student record in 0:06 the array, and print out the students name, track, points, and achievements. 0:10 To do this, you'll need to use a loop. 0:15 Loop through each element of the array, and build up a message that 0:17 contains all of the student records, then print that message to the page. 0:21 The finished project should display a report like this. 0:26 The tricky part, is getting to the actual property value of each object. 0:30 Remember, we can use dot notation to access a property of an object. 0:35 For example, student.name, accesses the name property of an object name student. 0:39 But in this case, you'll be accessing array elements. 0:46 So, you need to also use bracket notation to get to the array element. 0:49 For example, you created an array of student data, and 0:54 named that array students. 0:57 To get to the first student object, you'd use bracket notation, and 0:59 an index value of 0, like this. 1:03 [NOISE] Then, to get to the name of that student,. 1:06 You would add on the name property, using the dot notation, like this. 1:09 [NOISE] Got it? 1:13 I know, you can figure this out. 1:16 In the next video, I'll show you, how I programmed a solution to this challenge. 1:17 Good luck. 1:22
You need to sign up for Treehouse in order to download course files.Sign up