Practically? Yes. You can create an array of arrays which functions as an 2D array as every item is an array itself:

let items = [
  [1, 2],
  [3, 4],
  [5, 6]
];
console.log(items[0][0]); // 1
console.log(items[0][1]); // 2
console.log(items[1][0]); // 3
console.log(items[1][1]); // 4
console.log(items);
Run code snippetEdit code snippet Hide Results Copy to answer Expand

But technically this is just an array of arrays and not a “true” 2D array, as I. J. Kennedy pointed out.

It should be noted that you could keep nesting arrays into one another and so create “multidimensional” arrays.

Answer from Ballsacian1 on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-array-of-arrays
JavaScript Array of Arrays - GeeksforGeeks
August 5, 2025 - Here, each sub-array represents a group of related items. Sometimes, you might want to convert a nested array into a single array. This is known as flattening the array. JavaScript provides a convenient method flat() to achieve this.
Discussions

Creating 2D array in javascript
Hi All, I have a below code in which I am trying to fill the data from table that has few rows and columns. The problem is that I am unable to get the right value at indexes outside the loop. I need to add values at each row of the array and return the array to use in other functions. More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
9
0
January 9, 2023
How to create an array of arrays using a loop
have you tried reading the mdn docs on your array constructor? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Array you'e creating a new array, but you're putting the temp_array into a new array. You're not creating a new version of temp_array. this is what it should look like; const array_of_arrays = []; const loopOne = 5;//where loopOne is the random amount of times array_of_arrays is meant to loop? const loopTwo = 3;//the random length of the loop for the temp_array for( let i = 0; i < loopOne; i++ ){ let temp_array = []; for( let j = 0; j < loopTwo; j++ ){ temp_array.push(j); } array_of_arrays.push(temp_array); } console.log(array_of_arrays); More on reddit.com
🌐 r/learnjavascript
9
2
March 31, 2023
An array of arrays of arrays?
Absolutely. You can create multiple arrays and then store each of those collections into a new array. You could continue doing that, but it'd probably get messy, code wise, and potentially detrimental to performance if your data was structured that way. More on reddit.com
🌐 r/javahelp
9
2
July 24, 2019
Whats the difference between a multidimensional array in Javascript and a true multidimensional array?
With "true" multidimensional arrays, the dimension sizes are enforced (and typically fixed). With a JS multidimensional array, as you have laid out, if you change the size of e.g. b[0], the sizes of the other arrays do not change. The result is a jagged array. This SO question is more in-depth, though it talks about C# and not JavaScript: Why we have both jagged array and multidimentional array More on reddit.com
🌐 r/javascript
9
17
October 17, 2011
🌐
W3Schools
w3schools.com › js › js_arrays.asp
JavaScript Arrays
Arrays are a special type of objects. The typeof operator in JavaScript returns "object" for arrays.
🌐
DEV Community
dev.to › byte-sized-news › creating-arrays-of-arrays-nested-arrays-in-javascript-common-pitfalls-and-best-practices-20de
Creating Arrays of Arrays (Nested Arrays) in JavaScript: Common Pitfalls and Best Practices - DEV Community
August 1, 2025 - Uh-oh! When you modify arr[0], you end up modifying every sub-array, because all elements of arr point to the exact same array in memory. This happens because in JavaScript (and many other languages), arrays and objects are reference types.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array
Array - JavaScript | MDN
July 28, 2026 - The Array object, as with arrays in other programming languages, enables storing a collection of multiple items under a single variable name, and has members for performing common array operations. In JavaScript, arrays aren't primitives but are instead Array objects with the following core ...
🌐
Sentry
sentry.io › sentry answers › javascript › how can i create a two-dimensional array in javascript?
How can I create a two-dimensional array in JavaScript? | Sentry
February 15, 2023 - The Array() constructor can be called with or without the new keyword. Both constructions create an array instance. Youtube How Sentry.io saved me from disaster (opens in a new tab) Resources Improve Web Browser Performance - Find the JavaScript code causing slowdowns (opens in a new tab)
Find elsewhere
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › data types
Arrays
An array is a special kind of object. The square brackets used to access a property arr[0] actually come from the object syntax. That’s essentially the same as obj[key], where arr is the object, while numbers are used as keys.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › flat
Array.prototype.flat() - JavaScript | MDN
The flat() method of Array instances creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.
🌐
freeCodeCamp
freecodecamp.org › news › javascript-2d-arrays
JavaScript 2D Array – Two Dimensional Arrays in JS
November 7, 2024 - You make a similar change on all elements by looping through, even though 2D arrays in JavaScript are not strict. There are two options for creating a multi-dimensional array. You can create the array manually with the array literal notation, which uses square brackets [] to wrap a list of elements separated by commas.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › concat
Array.prototype.concat() - JavaScript | MDN
The concat method does not recurse into nested array arguments. The concat() method is a copying method. It does not alter this or any of the arrays provided as arguments but instead returns a shallow copy that contains the same elements as the ones from the original arrays.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-add-array-to-array-of-array
JavaScript - Add Array to Array of Array - GeeksforGeeks
July 23, 2025 - Here are the different methods to Array to an Array of Array (Multidimensional Array) in JavaScript · The push() method is one of the most common ways to add an array to an array of arrays. It adds a new element (in this case, an array) to the end of the array.
🌐
freeCodeCamp
forum.freecodecamp.org › curriculum help
Creating 2D array in javascript - Curriculum Help - The freeCodeCamp Forum
January 9, 2023 - Hi All, I have a below code in which I am trying to fill the data from table that has few rows and columns. The problem is that I am unable to get the right value at indexes outside the loop. I need to add values at each row of the array and return the array to use in other functions.
🌐
Code Institute
codeinstitute.net › blog › javascript › javascript arrays
Javascript Arrays: A Guide - Code Institute DE
December 20, 2022 - Since JavaScript arrays do not refer to associative arrays, it is impossible to access array items using random strings as indexes; instead, nonnegative numbers (or their corresponding string forms) must be used. Square brackets are used to indicate how to obtain an array’s elements. The array’s elements are each given an index. An array’s first index is always zero by default. The index value is enclosed in a set of square brackets, as in veggies [0], to retrieve a specific element from an array.
🌐
DEV Community
dev.to › sanchithasr › understanding-nested-arrays-2hf7
Understanding Nested Arrays in JavaScript - DEV Community
January 5, 2021 - An array is an ordered collection of values: each value is called an element, and each element has a numeric position in the array, known as its index. JavaScript lets us create arrays inside array called Nested Arrays. Nested Arrays have one ...
🌐
Zenva
gamedevacademy.org › home › web development › frontend development › a useful introduction to javascript multidimensional arrays
A Useful Introduction To JavaScript Multidimensional Arrays - GameDev Academy
Multidimensional JavaScript Arrays are basically JavaScript Arrays of arrays . For example: let mArr = [[1,2,3],[4,5,6,7]]. This allows for an intuitive way to store 2D, 3D, or even higher dimensional values.
Published: October 21, 2023
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › from
Array.from() - JavaScript | MDN
An iterable or array-like object to convert to an array. ... A function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and mapFn's return value is added to the array instead.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › Arrays
Arrays - Learn web development | MDN
Note: We've said it before, but just as a reminder — JavaScript starts indexing arrays at zero! Note that an array inside an array is called a multidimensional array. You can access an item inside an array that is itself inside another array by chaining two sets of square brackets together.