Jens, I assume you entered this in the console pane of the Espruino Web IDE... Doing so may conflict with the sending of the statement(s) / uploading and the execution of them because of the single threaded execution of JavaScript and setup of communication from console to Espruino board and back. Try to paste it in the edit pane and upload the code to the board. If this does not help, place it in a function, upload the function, and then invoke it. Take a look at this conversation. It covers some aspects of what you experience, even thought he conversation title may no read like that to you. Look for the 2 cents posts.
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.
Jens, I assume you entered this in the console pane of the Espruino Web IDE... Doing so may conflict with the sending of the statement(s) / uploading and the execution of them because of the single threaded execution of JavaScript and setup of communication from console to Espruino board and back. Try to paste it in the edit pane and upload the code to the board. If this does not help, place it in a function, upload the function, and then invoke it. Take a look at this conversation. It covers some aspects of what you experience, even thought he conversation title may no read like that to you. Look for the 2 cents posts.