Removing zeros from an array with JavaScript's filter() method
I recently completed a coding challenge on edabit.com where one of the objectives was to remove all 0 values from an input array. Naturally I reached for the filter() method to do something like this:
const array = [1, 0, 2, 0, 3, 0, 0, 4];
functio...
rcatwr.hashnode.dev1 min read