DEV Community

Discussion on: Javascript Array Condensing

Collapse
nestedl00p profile image
Nestor Rosales

const pushZerosToEnd = (arr) => arr.filter(n => n > 0).concat(arr.filter(n => n === 0));