Languages
[Edit]
EN

JavaScript - create two dimensional array

3 points
Created by:
Brandy-Mccabe
724

In this article, we would like to show you how to create a two-dimensional array in JavaScript​​​​​​.

By initialization

Edit

 

By assigning

Edit

In this example, we use Array() constructor to dynamically create empty two-dimensional array.

 

Reusable function

Edit

 

See also

Edit
  1. JavaScript - create multidimensional array

References

Edit
  1. Array() constructor - JavaScript | MDN

Alternative titles

  1. JavaScript - create 2d array
  2. JavaScript - declare empty two dimensional array (2D)
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join