The fixed issue was that last was initialized with a 'valid' value that created invalid values. From a coding point of view though I'd preferred to leave the initializer in the constructor but choose a different initialization value, for example, -1, which results as well in correct behavior. Last but not least I'd left it there for clarity and follow the style of Espruino's goody over that standard JS to complain about not initialized values. - just 1-1/2 cents. ;-)
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 fixed issue was that
last
was initialized with a 'valid' value that created invalid values. From a coding point of view though I'd preferred to leave the initializer in the constructor but choose a different initialization value, for example, -1, which results as well in correct behavior. Last but not least I'd left it there for clarity and follow the style of Espruino's goody over that standard JS to complain about not initialized values. - just 1-1/2 cents. ;-)