Copy machine code not working

newArr.push([…arr]); didn’t work i’m confused

herer is my code:

function copyMachine(arr, num) {
  let newArr;
  while (num >= 1) {
    // change code below this line
           newArr.push([...arr]);
    // change code above this line
    num--;
  }
  return newArr;
}

// change code here to test different cases:
console.log(copyMachine([true, false, true], 2));

thanks it works perfectly