It would be literally impossible to try and remember everything. There is just way to much to remember. Even professional developers look things up all of the time. So I think you are doing fine.
Idorecall is a flashcard app that I’ve taken to using to help me with spaced repetition for core concepts. I recommend making the cards in the form of a question in your own words. For example, “What is the syntax for a function in JS?” or “What method do I use to count the number of characters in a string?” Or even something like “How do I count the number of characters in a string?” might be an even better question. On the other side of the card, I give fairly (but not ridiculously) detailed explanations. The program then jogs your memory when you log in the next day. Even incorrectly answering the question is helpful because it starts training your brain to think like how a programmer might think of the problem. Developing thinking skills is more important than remembering minutiae as others have said.
Your goal shouldn’t be to remember everything. Your goal should be to learn what “tools” are out there to solve a problem so you can pull them out later.
So for example you might only need to remember that .filter can be used to get a new array from an old one by filtering over an array. The exactly syntax can be looked up.
If you find yourself learning a new concept, and then 5 minutes later you don’t remember what that concept was/is or how its used, then you probably didn’t learn it. As long as you remember enough to “pull it out later” then your set. Again, this doesn’t mean knowing everything 100% off the top of your head, only just enough to remember it exists in the first place.
It might take time, and you will forget things here and there, but thats where repetition and experience comes in. If you forget it now, review later as a refresher. The more you review something at later times, the more it becomes “muscle memory”. Same way you probably don’t need to remember the exact steps to tying your shoe, because such is already muscle memory.
Good luck! Keep learning, keep building, keep going