← Back to challenges

Filter Strings from Array

JavaScriptHardconditionsloopsstringsarrays

Instructions

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, "Innokodakademija", 1729, "Python", "1729"]) ➞ [0, 1729]

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

Notes

N/A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Is the Water Boiling?