var name = “John”;
var name2 = “Peter”;
var name3 = “Carl”
This can be problematic and has limited uses. What if we wanted to count all of the names that we just assigned? If all the variables are names, wouldn’t it be useful to combine them all into one single variable? Enter arrays. Simply put, an array is a variable that contains multiple values. Let’s jump straight into an example to better highlight how arrays work: