How do I make a two-dimensional array in JavaScript?

Asked 2 years ago, Updated 2 years ago, 39 views

No matter how much I search the Internet, there is no word on two-dimensional arrangement

How do I make a two-dimensional array in JavaScript? And how do you approach a member? (myArray[0][1] or myArray[0,1])?

javascript array

2022-09-22 15:07

1 Answers

var items = [[1,2],[3,4],[5,6]];
alert(items[0][0]); // 1

I hope it helps.


2022-09-22 15:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.