-
• #2
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.
most JS interpreters scan ahead for new function definitions within its current scope
Espruino's JS does not