ScanNetworks example works on Web editor but not on Arduino IDE

I have a Nano 33 IOT board, and when I tried this example:
It works on the web editor and it can scan the networks.

When I tried the same code on Arduino IDE on Mac, it complains that "WiFi shield not present", which is from the source code line 29-30 "if (WiFi.status() == WL_NO_SHIELD) {".

Is there a different between the WiFi library on the web editor and the Mac IDE? How can the same piece of code are compiled and run differently?


Never mind, I found out that the library should be WiFiNINA instead of WiFi for Nano 33 IOT board. It is working now.