Hello, so this is my technical test and it looks like I need input and even help from you guys
Test:
Create a function that accepts a multidimensional array in the form of a matrix. The matrix is then transposed to become as follows:
input: [
[1,2,3],
[1,2,3],
[1,2,3]
]
output: [
[1,1,1],
[2,2,2],
[3,3,3]
]
Rules:
Must manage input
Dont use build in function
Iam just trying like this,
But unfortunately that might be against the rules because no input occurs. Possible
function arrMulti(arr) {
let output = [];
arr.forEach(function(part, i, theArr) {
theArr[i] = [i+1, i+1, i+1];
output = theArr;
})
console.log(output);
}
arrMulti([
[1,2,3],
[1,2,3],
[1,2,3],
]);
Is there a better way?