Different types of arrays

There are 2 main types of arrays in JavaScript:

  • Single-dimensional arrays: These arrays have 1 line of elements.
  • Multi-dimensional arrays: These arrays have multiple lines of elements.

Here are some examples of different types of arrays in JavaScript:

  • Single-dimensional array of numbers: [1, 2, 3, 4, 5]
  • Multi-dimensional array of numbers: [[1, 2, 3], [4, 5, 6], [7, 8, 9]]