Data transformation with Code instead of Function node

I had a hard time getting the hang of data transformation with the Function nodes, and now I’ve got to get used to the different syntax in the Code node …

Here’s an example of what works fine with the old FunctionItem node, but I can’t get it to work in the new Code node.

Any ideas are very welcome!

Sample workflow:

This is what you need: