The command-line still evaluates everything in order, as you type it... The if statement won't evaluate again unless you tell it to.
You could do something like:
setInterval(function() { if (a != b) { var b = a; var c = 1; var d = 1; var e = 1; var f = b+c+d+e; } },100);
And now, that code will keep being called every 100ms so if you write a=20, everything will update as you expect.
a=20
@Gordon started
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.
The command-line still evaluates everything in order, as you type it... The if statement won't evaluate again unless you tell it to.
You could do something like:
And now, that code will keep being called every 100ms so if you write
a=20
, everything will update as you expect.