7 AnswersNew Answer
You can ask almost any code QUESTION on Stackoverflow. On github you can get some cool code repositories to learn how to code certain features.
stakoverflow is much better
If you google a coding question the result will often be an thread on SO. I don’t recommend you post or even register to SO until you are at an intermediate level.
I can't tell you which is generally the best solution. Try it for yourself. But I can tell you that for myself the best solution is to use github to see my personal progress (changes in coding, coding style and whatsoever). And if I want to code something what the program should do I Google it. My preferred source is the Mozilla Developer Network but there are a lot of very good sources. Ofc I checked stackoverflow as well but I deny simply copy and paste the solutions offered there.
using both is the best
None of them. Try out some projects, if you get stuck search at the documentation of your languages. You will learn a lot this way. if you still fail, then google again and search for the problem you have (not the solution). If you are still stuck, then search for solution. if then, none of them helped you to solve... StackOverflow would be a good place to help you. But make sure you spent at least 6 hours on searching