Labels aren't implemented because the way Espruino interprets code, it would be very difficult and inefficient to make them work - plus honestly I can't remember the last time I saw a label and goto in real code. The last time someone asked me about this was maybe 8 years ago?
So specifically you're interested in break to a label?
Honestly, it's hard to suggest 'an alternative' without any example but there's almost certainly a way of re-writing code in such a way where you don't have to use them.
It's worth noting that if you were planning on using breaks as a performance enhancement, it may not work the way you expect on Espruino because it's interpreting (and executing as it parses).
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.
Labels aren't implemented because the way Espruino interprets code, it would be very difficult and inefficient to make them work - plus honestly I can't remember the last time I saw a label and goto in real code. The last time someone asked me about this was maybe 8 years ago?
So specifically you're interested in
break
to a label?Honestly, it's hard to suggest 'an alternative' without any example but there's almost certainly a way of re-writing code in such a way where you don't have to use them.
It's worth noting that if you were planning on using breaks as a performance enhancement, it may not work the way you expect on Espruino because it's interpreting (and executing as it parses).