слыш мы не закончили
const notZero = n => n.filter(x => x !== 0)
const reallyZero = n => n.filter(x => x === 0)
const glueArray = (a, b) => [...a, ...b]
const zerosToEnd = (arr) => glueArray(notZero(arr), reallyZero(arr))
console.log(
zerosToEnd(array)
)