Advantages of arrays in JavaScript....

I’ve recently taken up JavaScript, and I’m to the section on arrays now. What I don’t get is, wouldn’t it require just as much typing to assign values to an array with five slots as it would to assign five different variables?

Maybe, but arrays allow you the opportunity to automate the process and loop through the variables without explicitly naming each one. There are other advantages, but that’s one of the biggies, IMHO.

Exactly what Fweeb said. You’re right, it is basically variables, but they’re named numerically within a single variable. There are many advantages to this.
I had to make an event calendar for my school’s website using JavaScript, and I used a LOT of arrays to make it list events, months, and days properly. Arrays are very useful.

I used arrays to make a whole set of text strings for translating national weather service forecast discussions using Javascript. Indispensible.