Filter Strings from Array

Published by BijogFc24 in

Create a function that takes an array of strings and numbers, and filters out the array so that it returns an array of integers only.

Examples

filterArray([1, 2, 3, "a", "b", 4]) ➞ [1, 2, 3, 4]

filterArray(["A", 0, "Edabit", 1729, "Python", "1729"]) ➞ [0, 1729]

filterArray(["Nothing", "here"]) ➞ []

Notes

N/A

Watch a quick demo on how Edabit works.