In JavaScript, you can create an array by enclosing a list of elements inside square brackets []. Here's an example:
In this example, we have created an array called myArray with three elements: "apple", "banana", and "orange".
You can also create an empty array and add elements to it later, like this:
This code creates an empty array called myArray, and then uses the push() method to add the elements "apple", "banana", and "orange" to the array, one by one.
// Output: ['h', 'e', 'l', 'l', 'o']