Метод map не работает

Почему не работает ?

 function filterRangeInPlace (arr, a, b) {
  return arr.filter(item => item > a && item < b);
}

let arr = [5, 3, 8, 1];

filterRangeInPlace(arr, 1, 4); // удалены числа вне диапазона 1..4

alert( arr ); // [3, 1]

Ответы (1 шт):

Автор решения: Igor

function filterRangeInPlace (arr, a, b) {
  return arr.filter(item => item > a && item < b);
}

let arr = [5, 3, 8, 1];
let arrFiltered = filterRangeInPlace(arr, 1, 4);
console.log(arrFiltered);

→ Ссылка