Replace + with a blank space and replace %40 with @ in Javascript from Get method form

I’m using getQueryVariable(“FirstAndLastName”); to get data from a URL which gets that data from a form using the Get method. How do I use JS to replace the + between words with a blank space, and replace the %40 with @ when I save them as variables?

decodeURI() - JavaScript | MDN (mozilla.org)
String.prototype.replace() - JavaScript | MDN (mozilla.org)

For some reason this solution worked for me.

That will work in some circumstances, but what if your get request returns other characters that have been encoded?

I am not sure but it works for my limit purposes so I am happy. :grinning: