My inquiry is similar to the one linked below, however, I am seeking a solution using JavaScript
How to Transpose 2D Matrix Stored as C 1D Array
In essence, I have a square matrix in two dimensions
1 2 3
4 5 6
7 8 9
This matrix is stored like this
let anArray = [1 ,2, 3, 4, 5, 6, 7, 8, 9]
Is there a way to transpose this matrix so that the order of elements in my source array changes according to the following pattern?
let newArray = [1, 4, 7, 2, 5, 8, 3, 6, 9]