How can I use Function and JavaScript to reverse string?

Hello, I just started using n8n and don’t know JavaScript, but I needed to reverse a string that I get from JSON when I request via HTTP Request.

This is what the line I need looks like:


This string is encoded in Base64 and reversed. I solved the problem of decoding the string, but I can’t reverse it.
As a result, you should get a line like this:


So please help me solve this problem.
I don’t understand how to adapt the javascript code to work in n8n.
If you can explain your solution to this problem in detail, I would be very grateful.

1 Like

Hi @Igor_Makarov

Welcome to n8n community :tada:

Here is the example workflow for your usecase.


It’s beautiful!
I didn’t expect to get help so quickly.
Thank you, it works just the way I need it to.


Glad it helps :smile:
Enjoy :tada: