AI Hints
Home›JavaScript Tutorial›Practice: Arrays
JavaScript · Lesson 57 of 138

Arrays Quiz

Test yourself.

⏱ 2 min read▶ Video at 1:09:25🎓 Free
Watch this lesson in the JavaScript courseWatch on YouTube ↗Full JavaScript course

Let's check your array skills. Pause before each answer.

Arrays Quiz
From the video: Arrays Quiz
  • Five questions
  • Pause and think
  • Then listen

Question 1

What index does the first item of an array have? The answer is zero.

Quick check
First index?

Question 2

Which method adds an item to the end of an array? The answer is push.

Quick check
Add to the end?

Question 3

Which method keeps only the items that pass a test? The answer is filter.

Quick check
Keep items that pass?

Question 4

What does sort do to the numbers one hundred, twenty five, and three, without a compare function? It sorts them as text. One hundred, twenty five, three.

Quick check
[100, 25, 3].sort()?

Question 5

Which method changes the original array, slice or splice? The answer is splice.

Quick check
Changes the original?

Summary

Excellent. Next, a new section, objects, for data with names.

Key takeaways
  • Index from 0
  • map, filter, reduce
  • Compare functions for numbers
Next up: Objects — named values