Arrays are a useful way to store data. They use special symbols ‘[]’ to declare them. They are similar to variables as they also have a name and store data. But instead of storing a single value of data, it can store multiple.
Arrays are made of elements and indexes. Each element is given 0 instead of 1 starting from the first element. It is important to be mindful of this when modifying the elements in an array.
Arrays are declared like this:
Array = [] // empty array
Array = [1,2,3,4,5] // array with numbers
Array = [‘coding’,’is’,’fun’] // array with strings