As Espruino is an interpreter each line of your code is read separately, then executed before moving on to the next line of code. If not inside a loop, once there are no more instructions to interpret and execute, that code block at that point is effectively ended.
The code could look out for a button press or screen tap and respond accordingly, such as returning to the default clock or to the app launcher.
Timers and set watches could be used looking for events.
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.
Sun 2021.10.17
Did the long press not return to the default app?
As Espruino is an interpreter each line of your code is read separately, then executed before moving on to the next line of code. If not inside a loop, once there are no more instructions to interpret and execute, that code block at that point is effectively ended.
The code could look out for a button press or screen tap and respond accordingly, such as returning to the default clock or to the app launcher.
Timers and set watches could be used looking for events.