Do arrow functions save more memory than normal functions?
Yes and no - they use less characters so that's less bytes for the actual code. However when they're defined they often use 2 more variables since they have to store this for each function.
If you're using the pretokenise flag then the function keyword gets squished down so a lot of that benefit disappears.
The actual memory used should be the same on all platforms though.
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.
Yes and no - they use less characters so that's less bytes for the actual code. However when they're defined they often use 2 more variables since they have to store
this
for each function.If you're using the
pretokenise
flag then thefunction
keyword gets squished down so a lot of that benefit disappears.The actual memory used should be the same on all platforms though.