I'm afraid there is no way to do this right now - the chip may have some functionality for analog compare, but it isn't as easy as on digital io.
If you don't care about power consumption then just use setInterval to check every so often - otherwise I'm afraid you will have to create some analog circuit that will be capable of tripping the analog input.
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.
I'm afraid there is no way to do this right now - the chip may have some functionality for analog compare, but it isn't as easy as on digital io.
If you don't care about power consumption then just use setInterval to check every so often - otherwise I'm afraid you will have to create some analog circuit that will be capable of tripping the analog input.