Basically! JavaScript array is a collection of data (elements in all types of, such that string, number, boolean, an array). A pair of square brackets represents an array and is separated by ( , ).
Example:
[elementOne, elementTwo, elementThree, elementFour]
The position of array elements is known as an index and it starts with zero.
And, the total number of elements defines the length of an array, you can get the length of an array this way.
Also, you can get specific elements using an index of an array.
Now let's see another method to assign values in an array but no need to use this method, you can use the first method (literal method)
Now, we move towards Array methods. There are different types of array methods, let's see one by one.
push() method
Add a new element to an array at the end position.
pop() method
Remove the last element from an array
shift()
Remove the first element of an array.
unshift()
Add an element of an array at the beginning of the array.
Thank you