You could use movement from http://www.espruino.com/Reference#l_Bangle_getHealthStatus to detect if the Bangle is moving around at all, and also the HRM-raw event that comes from the HRM on Bangle.js 2 has a field for whether it thinks the Bangle is being worn (eg if something is close to the HRM) - but if the Bangle is on a table then it could still be fooled.
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.
You could use
movement
from http://www.espruino.com/Reference#l_Bangle_getHealthStatus to detect if the Bangle is moving around at all, and also theHRM-raw
event that comes from the HRM on Bangle.js 2 has a field for whether it thinks the Bangle is being worn (eg if something is close to the HRM) - but if the Bangle is on a table then it could still be fooled.