Introduction to Web Development Exercise 6: Arrays
This course has been updated! We now recommend you take the Complete Intro to Web Development, v3 course.
Transcript from the "Exercise 6: Arrays" Lesson
>> Nina Zakharenko: Can you guys read that? It says, My favorite fruit is undefined. And that's because we have declared this variable. But we don't have anything in it. So just a super quick exercise. Set the variable favoriteFruit to your favorite item in the array. Use that square bracket notation.
[00:00:23] And then.
>> Nina Zakharenko: It should update automatically and print out my favorite fruit is and your favorite fruit
>> Nina Zakharenko: So would need type along with you guys real quick.
>> Nina Zakharenko: My favorite fruit is an orange, so I'm gonna do fruits and 1.
>> Nina Zakharenko: So I actually don't need this because I declared that above.
>> Nina Zakharenko: Sorry, for those CodePen you're gonna have to click on Run one more time.
>> Nina Zakharenko: We'll just copy and paste this here.
>> Nina Zakharenko: So we try minus one, yeah, there's nothing in that spot so nothing going on