← Back to challenges

Remove Null from an Array

JavaScriptHardlanguage_fundamentalsarraysformatting

Instructions

Create a function to remove all null values from an array.

Examples

removeNull(["a", null, "b", null]) ➞ ["a", "b"]

removeNull([null, null, null, null, null]) ➞ []

removeNull([7, 8, null, 9]) ➞ [7, 8, 9]

Notes

N/A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Hurdle Jump