# We've got to put down the three-dimensional masses 3x3 (and find the average of all elements)

• It's a code like this, it's kind of ravishing, but it's empty in the sun. Help me figure out what's wrong.

``````let arr = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
];
let arr2 = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
];

function Massives(arr, arr2){
function ArrSum(arr, arr2){

let ArrSum = [
[],
[],
[],
];

for(i=0; i&lt;arr.lenght; i++){
let PodArr = arr[i];
let PodArr2 = arr2[i];
for(k=0; k &lt; PodArr.lenght; k++){
let sum = PodArr[k];
let sum2 = PodArr2[k];
let endSum = sum + sum2;
ArrSum[i].push(endSum);

}
}
return ArrSum;

};

function ArrSub(arr, arr2){

let ArrSub = [
[],
[],
[],
];
for(i=0; i&lt;arr.lenght; i++){
let PodArr = arr[i];
let PodArr2 = arr2[i];
for(k=0; k &lt; PodArr.lenght; k++){
let sub = PodArr[k];
let sub2 = PodArr2[k];
let endSub = sub - sub2;
ArrSub[i].push(endSub);

}
}
return ArrSub;

};

function ArrMid(arr, arr2){
for(i=0; i&lt;arr.lenght; i++){
let PodArr = arr[i];
let PodArr2 = arr2[i];
for(k=0; k &lt; PodArr.lenght; k++){
let mid = PodArr[k];
let mid2 = PodArr2[k];
var EMid =+ mid + mid2;
let endMid = EMid/(PodArr.lenght * arr.lenght);
return endMid;
}
}
};

console.log(ArrSum(arr, arr2));
console.log(ArrSub(arr, arr2));
console.log(ArrMid(arr, arr2));

}

console.log(Massives(arr, arr2));</code></pre></div></div></p>
``````

• Careful.

lenght - majority

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2