I think it used to be more realistic to expect people to remember more syntax off the top of their heads, because in the past more people were able to really specialise in a single language. So, it wasn't weird to expect that they got really deeply good at that one single language.
If you look at modern web application development, many people don't get to specialise like that. They need to know quite a wide range of languages, particularly if they are working cross-stack into the backend, data and devops layers.
In an app I work on right now you might touch HTML (via JSX), CSS (via SCSS), Typescript, C#, nodejs tooling, .net tooling, Powershell scripts and some specialised data APIs. Then you get into the various CI/CD, deployment and cloud hosting parts of the system used to deploy it.
Even if you wanted to very broadly lump these together as "Javascript and .Net" it's still two different ecosystems to keep in your head. So, being able to remember the specifics of your algorithm implementation becomes less important than knowing the shape and capabilities of that algo... as does the ability to quickly assemble solutions in a new context. "I think this system has an API for that... (googles to confirm)... and I can probably use X algorithm to make use of it, it worked in another language (googles for an implementation in the current language)..." etc.
If you are worried about losing language fundamentals, maybe try having a personal library of isolated implementations. So you have a file somewhere that you've worked on and commented while you got the algo working, so if you need it again you can go back to your personal store of code. It can quickly refresh your memory and since the implementation wasn't done in-situ it's likely to be more 'liftable' to your new use case.