I'm pretty sure that str += "more text" will do a proper append automatically as-is, so it should be pretty fast.
str += "more text"
If you're interested the code is here
It won't work if the string is referenced elsewhere though:
var str = "Hello "; var foo = str; str += "more text"; // It's done a copy in this case.
@Gordon started
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.
I'm pretty sure that
str += "more text"
will do a proper append automatically as-is, so it should be pretty fast.If you're interested the code is here
It won't work if the string is referenced elsewhere though: