Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Arrays Multidimensional Arrays Review JavaScript Arrays

fill in the multidivisional array

I have watched the video twice for this quiz and cannot figure what code to use

2 Answers

Hi Alana!

I'm not sure exactly which question you are stuck on, so I'll answer this way:

Quiz Question 1 of 5

Which of the following is an example of a multidimensional array?

Answer:

const scores = [
  [ "Andres", 89, 99 ],
  [ "Lora", 100, 97 ], 
  [ "Kaya", 75, 80 ],
  [ "June", 77, 81 ]
];

Quiz Question 2 of 5

Please fill in the correct answer in each blank provided below.

Answer:

const itemsA = [ 'Lightsaber', 'Mockingjay pin', 'Box of chocolates' ];
const itemsB = [ 'Ghost trap', 'The One Ring', 'DeLorean' ]
const allItems = [ ...itemsA, ...itemsB ];

Quiz Question 3 of 5

Please fill in the correct answer in each blank provided below.

Answer:

const colors = [ 'tomato',  'crimson', 'darkred', 'firebrick' ];
colors.indexOf('darkred'); // 2

Quiz Question 4 of 5

Please fill in the correct answer in each blank provided below.

Answer:

// Consider the following multidimensional array:

const coords = [
  [0, 2],
  [1, 3],
  [2, 4]
];

//Complete the code below by accessing the values inside the second nested array.
// The console.log() statement would output x: 1, y: 3.

console.log( `x: ${coords[1][0]}, y: ${coords[1][1]}` );  // x: 1, y: 3

Quiz Question 5 of 5 Consider the following code:

const morningTasks = [ 'study', 'exercise', 'write' ];
const eveningTasks = [ 'bake', 'edit article',  'chill' ];
const allTasks = [...morningTasks, ...eveningTasks];
morningTasks.pop();

What is the length value of the allTasks array after the above code runs?

Answer: 6

I hope that helps.

Stay safe and happy coding!

Thank you for your help!

Alana