You could also use a 256 element precomputed lookup table I believe:
var lut = new Uint8Array(256); for (var i=0;i<256,i++) lut[i] = i*0.8; // ... then in a loop ... E.mapInPlace(buffer,buffer,lut)
@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 also use a 256 element precomputed lookup table I believe: