I'm new to javascript arrays. How can I create such a matrix?
[0, 1]
[3, 2]
[4, 5]
[6, 7]
[8, 9]
I'm new to javascript arrays. How can I create such a matrix?
[0, 1]
[3, 2]
[4, 5]
[6, 7]
[8, 9]
A matrix is an array of arrays so just put those arrays into another array, assign it to a variable and you're ready to start using it in any way you want:
let matrix = [
[0, 1],
[3, 2],
[4, 5],
[6, 7],
[8, 9]
];