Actually I just tried this:
while (true) { while (true) { if (true) { break; } } if (true) break; }
And it breaks on 1v99 but works on cutting edge - so I'd just update your firmware. I will do a proper numbered release this week anyway hopefully.
With the new firmware you also have the option of using Array.find, but Array.filter exists in the 1v99 build and might tidy this up nicely as well.
Array.find
Array.filter
Not tested, but you get the idea:
var matches = aAp.filter(function(ap) { return aMyAp.filter(myAp=>ap.ssid==myAp.ssid).length; }); if (matches.length) // connect with matches[0]
@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.
Actually I just tried this:
And it breaks on 1v99 but works on cutting edge - so I'd just update your firmware. I will do a proper numbered release this week anyway hopefully.
With the new firmware you also have the option of using
Array.find
, butArray.filter
exists in the 1v99 build and might tidy this up nicely as well.Not tested, but you get the idea: