Just noticed that in Node-red 3.1.3 that the transform function shows as error in JSONata test. I am pretty sure this worked fine prior to 3.1. If i inject a value into this expression it all works fine.
[edit] Issue raised at github Jsonata editor test error with transform function (3.1.3) · Issue #4504 · node-red/node-red · GitHub