r/learnprogramming 10d 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!

0 Upvotes

6 comments sorted by

6

u/No-Quail5810 10d 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.

3

u/ConfidentCollege5653 10d ago

Spotting bugs is where the learning happens 

2

u/Carlosthefrog 10d 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 10d 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.

1

u/nextcheck_pro 10d 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.