Answer by Johan Öbrink:
IoT is fundamentally event driven. In that sense, JS is a perfect match. You do not want to spend precious battery power on running a while(true) loop that constantly checks for values and spawns conditional events. Instead you want the system to tell you when and what happened and then you can react to that.