var names = [”John”, “Peter”, “Carl”];
As you can see, we declare an array using square brackets [] with a list of values inside it. Just like with objects, the commas are important. They denote that there is another item after the current one. Just like with objects, we can make use of spaces and line breaks to help format our code. Take the above example. We can very easily write this as: