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

This's so confusing

why Dave is using [] ?

Will you explain more, this is basically a representation of empty array.

  var a = [];

"a" is a bucket being set aside to put things in later, perhaps when going through a loop.

1 Answer

Hi Patti!

the brackets [] represent an empty array. An array is basically a list of values in a single variable that you want to do something with so you don't have to create multiple variables of very similar objects, strings, integers, etc. There are many, many reasons to use an array but if you are confused on Dave's usage of arrays I highly recommend reviewing the video and taking notes.