let arr = [1,2,3,4,5,6,7]; const filterArr = (a) => { arr = a.filter(o => o > 5); } filterArr(arr); console.log(arr);