It will switch to input mode, try with pin.getMode() to see after calling digitalRead.
Also there is now no explicit mode name to set it to be disconnected/floating again (e.g. like pin.mode("disconnected")). on nrf52 devices analogRead does that. In fact floating pins on nrf52 are reported as "analog" (even for pins 4-27 that cannot be used for analog reading) and pin.mode("analog") seems to set it floating/disconnected - at least on nrf52 platform.
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.
It will switch to input mode, try with pin.getMode() to see after calling digitalRead.
Also there is now no explicit mode name to set it to be disconnected/floating again (e.g. like pin.mode("disconnected")). on nrf52 devices analogRead does that. In fact floating pins on nrf52 are reported as "analog" (even for pins 4-27 that cannot be used for analog reading) and pin.mode("analog") seems to set it floating/disconnected - at least on nrf52 platform.