Hi All, I started using testing plugin in the IDE. I found an issue with boolean value setting. It could be my very basic knowledge of JS but here it is.
I am trying to change the value of a boolean variable with a button from the testing plugin. This is the code:
var my_bool = true;
var bool_test = function(){
if (my_bool) console.log("true");
else console.log("false");
};
setInterval(bool_test, 1000);
then I run the program and test. After toggling the test button, my_bool variable is still true. Same code works fine with numeric values.
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 All, I started using testing plugin in the IDE. I found an issue with boolean value setting. It could be my very basic knowledge of JS but here it is.
I am trying to change the value of a boolean variable with a button from the testing plugin. This is the code:
then I run the program and test. After toggling the test button, my_bool variable is still true. Same code works fine with numeric values.
1 Attachment