The issue you have is that Espruino doesn't keep built-in variables/functions in the symbol table, because there's just not enough RAM. That means that while you can access a variable or function by name, you can't access it as if it were an actual member of the object. It's something I'm hoping to fix - there is a bug open for this but it's a reasonably big change.
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.
Hi,
The issue you have is that Espruino doesn't keep built-in variables/functions in the symbol table, because there's just not enough RAM. That means that while you can access a variable or function by name, you can't access it as if it were an actual member of the object. It's something I'm hoping to fix - there is a bug open for this but it's a reasonably big change.
However nothing stops you from doing:
or even:
Or if you're still absolutely set on accessing everything by strings, you can do:
Note that because Espruino executes from source, there isn't much overhead to running
eval
Hope that helps...