The main difference I can see between your code and the reference video is that you’re returning 1 item using {.}, and the code in the video is returning an array [.]. But keep in mind that the code in the video is also returning only 1 item.
You can use one of the other depending on what you want to do.
You are totally right that was test code.
If I return an array the results are the same but in the video I see inputs are the same Java Script code is the same but output is not.
I think that the last thing I can contribute here is that in the left section, you should have something similar to this in JSON format. Please check how you can get that from the previous node, so you have the output you wish in the right section.