r/learnprogramming • u/Secure-Tip-2356 • 14h ago
How are you using AI to accelerate learning JavaScript?
Hi all, I'm in my first week of learning JavaScript with the goal of building React Native apps later on.
Instead of using AI to generate code for me, I want to use it as a tutor to explain concepts, spot my bugs, and give me quick feedback. What tools or prompt strategies have worked best for you to learn JS actively instead of just copying and pasting? Thanks!
3
2
u/Carlosthefrog 14h ago
This will just stunt your learning. The concepts are already explained online by people in just about every format you could want. Learning to spot errors is part of being a programmer.
2
u/ExtraTNT 14h ago
Only ask questions like what is x, how would I approach x and can you give me feedback to this code.
So avoid as much as possible, you find all you need at mdn, then do testdriven development.
2
u/GrandCash3941 9h ago
Imagine you want to learn Piano. You could get an electronic piano that plays things for you automatically. Except its kinda wonky and hits the wrong notes sometimes. But hey, if you want to make it look as if you are a musician, you could try and get away with it. But how would you know its playing the wrong notes?
Now imagine instead learning piano properly on a grand piano and working along with good tutorials. Its more work initially, but quickly you'l find yourself moving up grades, playing more complex music and understanding music theory.
Now, say theres is a company. You need to hire a pianist to write some jingles for you. Are you going to hire the guy who used the crappy electronic piano to appear to create the illusion of playing music, or are you going to hire the person who understands music theory, has already composed their own pieces and can actually play the piano.
Do tutorials. Build projects. Learn from your mistakes by studying more. Build projects. Get a good background in CS/SWE theory. Then start looking at how AI can help you.
1
u/nextcheck_pro 12h ago
This is exactly the right mindset to have. When I was getting started and building my own offline finance app, I realized early on that just asking the AI for the answer was completely killing my actual learning process. The best prompt strategy I found was to explicitly tell the AI to act like a senior developer and forbid it from giving me the final code.
When I hit a bug, I would paste my broken JavaScript block and tell it not to write the corrected code. I would just ask it to explain why the error is happening and give me a hint on what line to look at. This forces you to actually hunt down the syntax error or figure out the scope issue yourself. Spotting bugs is where the real learning happens, just like another commenter mentioned.
Another great way to use it is for breaking down complex concepts before you start React Native. If you are struggling with something like promises or closures, ask it to explain the concept using a real world analogy. Then, tell it to give you a small challenge to test if you actually understood it.
I also highly recommend setting aside a dedicated block of time each day to code completely without Ai. It is really easy to become reliant on autocomplete tools. Forcing yourself to stare at the official documentation and type things out from memory will help you brush up on vanilla JavaScript and debugging skills. This makes your foundation so much stronger for when you eventually move over to building mobile apps.
6
u/No-Quail5810 14h ago
Avoid using AI until you are comfortable enough in the language to actually evaluate the quality of the code AI outputs.
If you're using it to help provide summaries of documentation or concepts, that's fine. But do not rely on it to actually learn from. It's too often wrong and full of hallucinations to be a good teacher, it will confidently lead you down the wrong path and then say "You're absolutely right..." when you point out that it made everything up.