I am a relatively new user of the Bangle.js. I was playing around with the button and touch functionality of the watch in the emulator.
I am trying to declare a global variable inside of a function. I am aware that the way to do this in JavaScript is to prepend the variable declaration with the word 'window', like below:
window.a = 'abc';
When I try to do the same inside my code, it is giving me an "Uncaught ReferenceError: "window" is not defined" error message.
Am I missing something here? I have uploaded my code snippet for reference.
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.
Hi,
I am a relatively new user of the Bangle.js. I was playing around with the button and touch functionality of the watch in the emulator.
I am trying to declare a global variable inside of a function. I am aware that the way to do this in JavaScript is to prepend the variable declaration with the word 'window', like below:
window.a = 'abc';
When I try to do the same inside my code, it is giving me an "Uncaught ReferenceError: "window" is not defined" error message.
Am I missing something here? I have uploaded my code snippet for reference.
I would like to set my secondInterval variable to be a global one, so that it can be cleared from outside the function where it is defined.
Any help would be greatly appreciated.