How would you send data from an Nano 33 IoT to a computer?

You need to comment the while(!Serial). This line will stop the sketch until the Serial Monitor or Plotter window is opened.