You are reading a single comment by @maze1980 and its replies. Click here to read the full conversation.
  • being an async progamming language.

    do you mean javascript ES7 which supports async / await changed the nature of language?

  • No, it's still async. In Espruino you can take the block "Wait BTN1 both edge do", that is basically the same as an await. And ofc the "sleep" functions implemented in ES7 are still async, if there's any function triggered while a "sleep" function is "active" that function will be executed.
    The give an example:
    -You have the LED "toggle" function, switching an LED on and off every 1 second, either with setInterval() or with a ES7 "sleep" function.
    -You have another "fancy" function to do some fancy stuff, taking 3 seconds.
    Whenever the "fancy" function is executed your LED will stay on (or off) for 3..4 seconds, because the "toggle" function is only executed after the "fancy" function has completed, because there's no multitasking and things run async.

About

Avatar for maze1980 @maze1980 started