dakus,
<body>
<script>
function createArr()
{ const arr = [];
let elem;
while ((elem = prompt(`Введите значение ${arr.length + 1}-ого элемента массива`)) !== null) arr.push(Number(elem)||0);
return arr
}
function middle(arr)
{
let sum = 0;
for (let x of arr) sum += x;
let midpoint = sum / arr.length;
let count = 0;
for (let x of arr) count += x < midpoint ;
return {arr, midpoint, count};
}
let arr = createArr();
document.body.append(JSON.stringify(middle(arr)))
</script>
<br>
<script>
function maxMin(arr)
{
let max = arr[0], min = arr[0];
for (let x of arr) {
if(x > max) max = x;
if(x < min) min = x;
}
let clone = [], up = true;
for (let x of arr) {
if(x == min) up = false;
if(up) x *= max;
clone.push(x);
}
return {arr, max, min, clone};
}
let ar = createArr();
document.body.append(JSON.stringify(maxMin(ar)));
</script>
</body>