It's not an entirely fair comparison if you've got x=0 in the for loop but not in any other loops, but I believe for will be slower anyway, just because Espruino is having to jump between 3 different places (the loop iterator, condition and body)...
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.
It's not an entirely fair comparison if you've got
x=0
in the for loop but not in any other loops, but I believefor
will be slower anyway, just because Espruino is having to jump between 3 different places (the loop iterator, condition and body)...The fastest would be: