DEV Community

Discussion on: Javascript Array Condensing

Collapse
louissimps profile image
Louie Simpson

arr.slice().filter(el => el !== 0).concat(arr.slice().filter(el => el == 0));

Collapse
lehmannsystems profile image
Mike Author

love this solution - standard javascript and easy