DrAzzy's spot on. 2 memory units per entry and each memory unit is 20 bytes, so just by allocating an array you're using a lot of memory.
I have an issue open (I have no idea when I'll get around to doing it) that may halve memory usage in these cases, but you'll still run out of memory quickly when working with 'normal' arrays.
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.
DrAzzy's spot on. 2 memory units per entry and each memory unit is 20 bytes, so just by allocating an array you're using a lot of memory.
I have an issue open (I have no idea when I'll get around to doing it) that may halve memory usage in these cases, but you'll still run out of memory quickly when working with 'normal' arrays.
There's a bit of info here: http://www.espruino.com/Performance
You can create a Uint8Array and then use the
.set
function to set its value to that of a string (it's not strictly JS compliant, but it's handy :)