Matrix M consists of 6 rows, 8 columns. Find out how many elements in each row exceed the arithmetic average value determined for this row. From the values found to make an array R.
Ps made a variable, it was conceived as an arithmetic average of the line, but it did not work out
var theArithmeticMean = 0; function getRandomInt(min, max){//Функция для генерации случайного числа return Math.floor(Math.random() * (max - min)) + min; } function CreateAnArray(rows,columns){ //Функция, которая создаёт двумерный массив var arr = new Array(); for(var i=0; i<rows; i++){ arr[i] = new Array(); for(var j=0; j<columns; j++){ arr[i][j] = getRandomInt(0, 10); theArithmeticMean += parseInt(arr[i][j]); } } return arr; } var myMatrix = CreateAnArray(8,6); //Вызов функции для создания массива console.log(myMatrix); console.log(theArithmeticMean);