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 Adding and Removing Items from Arrays

Vijayalaxmi vastrad
Vijayalaxmi vastrad
2,789 Points

Complete the code below to store the number of items in the array scores into the variable totalScores:

var scores=[76,79,76 23,98]; var totalScores=score._?

2 Answers

hello. it wants you to store how many items the array contains, and store the value in the totalScore variable. to check how many items an array contains you can simply check the length of the array

var arrayLength = scores.length;

i hope this helps

Vijayalaxmi vastrad
Vijayalaxmi vastrad
2,789 Points

yes, its correct. thank you so much.