Is there an elegant way to transfer this line of jython code into javascript? unfortunately my programming skills are too limited …
listOfMembers = [(Transformation.transform("MAP", "sensoren.map", item.name) or item.name) for item in ir.getItem("gLacrossSensorExpired").members if item.state == OFF]
List comprehensions are only a Python thing. You will have to use the filter, map, reduce, forEach, etc. functions on Array - JavaScript | MDN (Item.members returns a JavaScript Array).
It’s been awhile since I’ve done Python but I think it would translate to something like (using openhab-js 4.0+):
var lostOfMembers = items.gLacrossSensorExpired.members
.filter( i => i.state == 'OFF')
.map( i => actions.Transformation.transform('MAP', 'sensoren.map', i.name));
Note I just typed that in. There are probably errors. Check the docs for details.