If we console.log the array, then it will show us all 4 elements listed in the array. The most common way to create an array in JavaScript would be to assign that array to a variable like this: const books = How to create an array in JavaScript using the assignment operator I will also show you how to create an array from a string using the split() method. In this article, I will show you 3 ways you can create an array using JavaScript. An array is a type of data structure where you can store an ordered list of elements.