You could run this beforehand...
String.prototype.replace = function(a,b) { var i = this.indexOf(a); if (i<0) return this; return this.substr(0,i)+b+this.substr(i+a.length); }
@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.
You could run this beforehand...