...opening curly brace - in line 12 - fell victim to the experience that allows writing code top of your head without testing... (EDIT: obviously fixed now). I like this variable option. Put it as a single line with (could not let go my 'Schnapszahl'):
setTimeout((release)?save:onInit,999);
I use a similar approach for my debugging, logging:
have a variable each for enabling / disabling it, for example lon for log is on
a log() that invokes console.log(arguments); to save space
invoking on one line `if (lon) log(...); to filter for final load
In (my) emulation I have an overwrite that logs way much more...
It is always a good approach to keep code changes the smallest between dev and release... last but not least also to be able to fall back in case debug is needed without having to change code but just the value of a variable.
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.
...opening curly brace - in line 12 - fell victim to the experience that allows writing code top of your head without testing... (EDIT: obviously fixed now). I like this variable option. Put it as a single line with (could not let go my 'Schnapszahl'):
I use a similar approach for my debugging, logging:
lon
for log is onlog()
that invokesconsole.log(arguments);
to save spaceif (lon) log(...);
to filter for final loadIn (my) emulation I have an overwrite that logs way much more...
It is always a good approach to keep code changes the smallest between dev and release... last but not least also to be able to fall back in case debug is needed without having to change code but just the value of a variable.