Though I'd recommend having the device for a hands-on experience, there are also several alternatives available as emulators and simulators, like here's a simulator: azure-samples.github.io/raspberry-pi-web-simulator and QEMU is an emulator.
But, if you have Windows with 'Ubuntu on Windows' or if you are running a Linux machine, then you can create your own build of Espruino from
http://gljlwkxe.llfrp.uk2.gsr.awhoer.net/espruino/Espruino, which can run on your PC and also communicate with the IDE via Telnet. While all your internet functionalities will work in this case, accessing real-world objects and parameters won't. So, you can either buy official Espruino boards pretty cheaply like at $25 or you could run the Espruino software on an ESP8266, which costs just around $5 for a USB connected board. Then again, unlike the plug and play Espruino, the ESP8266 isn't officially supported by the creators.
Now, the Raspberry Pi is also quite cheap like just $10 for the Zero W version with internet connectivity, but then you'll have to spend additionally on an SD card for it as well.
Finally, even if you're not up for buying a physical device, you could actually rent Raspberry Pis or use any of the available emulators. Plus, given the time you're likely to spend on learning IoT and using its devices, having the hardware will actually help you get more proficient with all its elements and widen the scope for real-time experiments.