let max = mx(...a.map(e => mx(...e)));
let min = mn(...a.map(e => mn(...e)));
max = -min > max ? min : max;
let result = a.map(e => e.map(e => e / max));
Вы явно что-то стандартное делаете явно геморроидальным способом.
function deleteElemsWith (arr, str) {
for (let i = arr.length - 1; i >= 0; i--) {
if(arr[i].includes(str)) {
delete arr[i]
}
}
return arr;
}
let newArr = deleteElemsWith(['Привет', 'как', 'Дела'], 'ак');
console.log(newArr);
var input = document.getElementById('input');
var keyInput = document.getElementById('key');
var parag = document.getElementById('parag');
var sub = document.getElementById('sub');
sub.addEventListener('click', grebl);
function grebl(){
var value = input.value.split(' ');
var key = keyInput.value;
for (var i = value.length - 1; i >= 0; i--) {
if(value[i].includes(key)) {
delete value[i]
}
}
return value;
console.log(value);
}
function deleteElemsWith (arr, str) {
for (let i = arr.length - 1; i >= 0; i--) {
if(arr[i].includes(str)) {
delete arr[i]
}
}
return arr;
}
let newArr = deleteElemsWith(['Привет', 'как', 'Дела'], 'ак');
console.log(newArr);