Was I right to use the solution?
I would say “no”, but that’s OK. I’d suggest you keep working on it until you understand the solution, then try to recreate it from memory. The only way to learn this stuff is to be bad at it until you’re good.
My suggestion is to never look at the solution until you get your own to work. That way you will feel you accomplished something and then look at the other solutions to see where you could optimize your own.
Since we have this great forum, it is much better for you to post your code on the forum and ask questions about next steps. You can always preface your post with "Please do not give me the solution, but give me a hint", so people hopefully will not ruin your learning experience.
If you don’t have a clue how to start on a particular challenge, you need to try to write out the steps on paper or type them out somewhere to capture the logic of your algorithm. You can always post your logic steps on the forum too, and we will be glad to give you hints about things to think about or maybe flaws in your current logic.
So, looking elsewhere for solutions is not terrible. If you’ve struggled for a long time, then OK. But you should understand the solution. Study it. Put it in a codepen and use some console.log statements to see what is happening. And if you still can’t understand, ask the forum. Open up a new thread (so it has a meaningful title) and ask. The more specific the question, the better the responses will be.
Programming can be hard. Don’t get frustrated. But it’s like a muscle - the more you use it, the stronger it gets.
thank you for the great replies, I think I have to use the forums more often.
It’s all good!