With the hundreds of methods available there is no way you will remember them all unless you are a genius. Remembering the wording for what you are trying to do is not important. Knowing what you want to do is important. For example, I want to get part of a string. I’ve completed the entire front-end section and part of the back-end. I can’t remember if it is:
let string = 'fruit is apple'
// I just want the string 'apple'
let fruit = string.substr(9, -1)
let fruit = string.slice(9)
let fruit = string.splice(-1, 9)
The bottom line is that I know what I want to do. If I know what I need to do, I can look it up in two minutes and be on my way. That is one of the things I like most about programming - you don’t need to memorize exact wording, or formulas, or expressions. As long as you know what you are trying to accomplish, you can do so in mere minutes with a Google search.
That being said, the more you do, the more you will remember, so repetition is important. And no, don’t keep going back to things you’ve already solved just to solve them again. If you want to try to solve them better, fine, but don’t punish yourself because you can’t remember.
EDIT: I looked up how to do what I wanted to do. It took me probably less than 30 seconds:
string.substr(string.length - 5)