Just to add to this - the ESP8266 needs to be able to execute tasks every so often to handle things like WiFi. If you block it executing them, it cannot function. Because of this there's a 'watchdog timer' which resets the whole device if a task doesn't complete in time, and that's what you're seeing.
@allObjects above has shown you how to do what you need - the lack of a delay function in Espruino is very much intentional - because it encourages behaviour that causes problems for many of the devices Espruino runs on.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Just to add to this - the ESP8266 needs to be able to execute tasks every so often to handle things like WiFi. If you block it executing them, it cannot function. Because of this there's a 'watchdog timer' which resets the whole device if a task doesn't complete in time, and that's what you're seeing.
@allObjects above has shown you how to do what you need - the lack of a
delay
function in Espruino is very much intentional - because it encourages behaviour that causes problems for many of the devices Espruino runs on.