const duplicateZeros = function (arr) {
const newArray = [];
for (let i = 0; i < arr.length; i++) {
if (arr[i] == 0) {
newArray.push(0);
newArray.push(0);
} else {
newArray.push(arr[i]);
}
}
for (let i = 0; i < arr.length; i++) {
arr[i] = newArray[i]
}
return newArray;
};