Community

How to Create an Array in JavaScript

(Kirupa Chinnathambi) The popular way in which all the cool kids create arrays these days is to use an open and close bracket. The example that follows is a groceries variable that is initialized to an empty array: