Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Loops, Arrays and Objects Tracking Multiple Items with Arrays Review Array Basics

Array Basics quizz

Hi for some reason I am having trouble filling in the blanks. Can someone please assist me. Thanks

2 Answers

Jacek Szemplinski
Jacek Szemplinski
6,423 Points

Hi Bianca,

Answers are:

  • Finish the code below to open an alert with the message "Arrays are awesome" in it:
var messages = [ "Hello", "Welcome", "JavaScript!", "Arrays are awesome", "Goodbye"];
alert ( messages[3] );
  • Imagine you have the following array:
var lottery = [ 1, 44, 32, 55, 12, 17];

Which code snippet would print out the number 1 to the JavaScript console?

console.log(lottery[0]);
  • Arrays are not used very frequently in JavaScript. FALSE

  • What is one way to think of an array? As a shopping list

  • This code creates an array, but there are two things missing. Fill in the blanks to complete the array.

var shopping = ["milk", "cookies", "eggs"] ;

Jacek.

Hi thanks for the reply. those are the answers i am using and im not sure why its not working