This question has already been answered:
The idea is that the code should cut out all the values from the array, except digits, but it is generally unclear what is happening, maybe I somehow did not use the ForEach function;
function filter_list(l) { l.forEach(onlyNumber) function onlyNumber(item, i, arr) { if(typeof item !== Number) { arr.splice(i, 1); } } return l; } console.log(filter_list(['a', 1, 3, 'b']));