It’s not possible to technically create a 2-dimensional array in JavaScript. But you can create an array of arrays like below:
var myArray = [
[1, 2],
[3, 4],
[5, 6]
];
//To access the array items
console.log(myArray[0][0]); // 1
console.log(myArray[0][1]); // 2
console.log(myArray[1][0]); // 3
console.log(myArray[1][1]); // 4
console.log(myArray);
If you want to learn more about Java, then go through this Java tutorial by Intellipaat for more insights.