how to remove letters from an array javascript 1

how to remove letters from an array javascript

function fromlist(l) {
  return l.filter(e => Number.isInteger(e));
}
// or this
function fromlist(l) {
  return l.filter(Number.isInteger);
}

Here is what the above code is Doing:
1. The filter() method creates a new array with all elements that pass the test implemented by the provided function.
2. The Number.isInteger() method determines whether the passed value is an integer.

Similar Posts