most JS interpreters scan ahead for new function definitions within its current scope
Espruino's JS does not
Yes, I'm aware of that. It's a side-effect of the way Espruino executes code as it parses.
Espruino does have the ability to work in a two-pass mode where this code would then work, but doing two passes really hurts execution speed so the decision was made not to turn the functionality on.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem