Well, if it works then I guess that's fine. It doesn't have to be too speedy.
If at all possible I'd check based on the actual feature though? I mean, if you need Bangle.isGPSOn then check for Bangle.isGPSOn!==undefined.
You could maybe also do something like turning 2v08.123 into 2.080123 and could just compare based on that? You just need to ensure you pad out the number after the '.' correctly.
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.
Well, if it works then I guess that's fine. It doesn't have to be too speedy.
If at all possible I'd check based on the actual feature though? I mean, if you need
Bangle.isGPSOn
then check forBangle.isGPSOn!==undefined
.You could maybe also do something like turning
2v08.123
into2.080123
and could just compare based on that? You just need to ensure you pad out the number after the '.' correctly.