DEV Community

Deolawage
Deolawage

Posted on

JavaScript Loops and Arrays Nearly Broke Me — The Odin Project

Four weeks of confusion, broken code, and slowly learning to see the solution before writing the code.

I'm currently working through The Odin Project, and recently I went through the JavaScript section covering **loops and arrays.

At first, I thought:

"Okay, I understand this."

I read through the lessons.

I followed the examples.

I understood what the code was doing.

Then I reached the assignments.

And that's when reality hit me.

I didn't actually understand it.


Reading Isn't the Same as Understanding

This was probably my biggest mistake.

I read through the material and felt like I understood the concepts because the examples made sense.

But when I was given an assignment and had to solve something myself, I just stared at the screen.

I knew what a loop was.

I knew what an array was.

But I didn't know how to use them to solve the problem in front of me.

It was like knowing the words of a language without knowing how to form a sentence.

That's when I realized:

I had been reading instead of learning.

So I Asked Claude for Help

At this point, I decided to get some help from Claude.

But I didn't want it to just hand me the answers.

I didn't want:

"Here's the solution. Copy this."

That wouldn't help me.

So instead, I used Claude to help me understand the **technical concepts behind the assignments.

Whenever I was confused, I'd explain where I was stuck.

Instead of giving me the entire solution, it would break down the concept and give me clues about what I should be thinking about.

Sometimes I'd get something like:

"Think about what you're trying to track while the loop runs."

Or:

"What should happen to each item in the array?"

Those little clues were often enough to get me moving.

And when they weren't...

Well, I went back and struggled some more.

The First Assignment Was Rough

I started the first assignment with almost no idea what I was doing.

I wrote some code.

It didn't work.

I changed something.

It still didn't work.

I broke the code.

Fixed something.

Broke something else.

At some point, I was probably just staring at the screen wondering why I had decided to learn programming.

But I kept going.

And something interesting started happening.

I Started Getting Better

The first few assignments felt like I was fighting the computer.

But as I progressed, things started becoming a little clearer.

I began understanding what the assignment was actually asking me to do.

I started breaking problems into smaller pieces.

Instead of immediately thinking:

"How do I write this code?"

I started asking:

"What exactly am I supposed to accomplish?"

Then:

"What data do I have?"

"What do I need to do with it?"

"Do I need to go through every item?"

"What do I need to keep track of?"

Those questions started changing everything.

Then Something Weird Happened

After working through enough assignments, I reached a point where I'd read an instruction and...

the concept would just come to me.

Not always.

I still got stuck.

But more often than before, I'd read the problem and think:

"Oh... I think I know what I need here."

Maybe it was a loop.

Maybe I needed to iterate through an array.

Maybe I needed to create another variable to keep track of something.

Maybe I needed to transform the data.

The important thing was that I wasn't just remembering some code I'd seen before.

I was beginning to recognize the type of problem.

And that felt different.

I Was Starting to Think in Code

This was probably the biggest change.

Before, I was looking at code and asking:

"What does this syntax mean?"

Now I was starting to look at a problem and ask:

"What logic would solve this?"

That's a completely different way of learning.

The syntax still matters, of course.

But eventually, you need to get past:

"What does for mean?"

and start thinking:

"I need to go through every item in this collection and do something with each one."

That's when programming starts becoming less about memorizing syntax and more about solving problems.

I Still Get Stuck

I don't want to make this sound like I suddenly became a JavaScript wizard after four weeks.

I didn't.

I still get stuck.

Sometimes I understand the problem but can't figure out the implementation.

Sometimes I have the right idea but write the wrong code.

Sometimes I completely misunderstand the problem.

And sometimes I spend way too much time on something that eventually turns out to be simple.

But there's one major difference now.

Being stuck doesn't feel as scary as it used to.

I know that if I keep breaking the problem down, looking at the concepts, experimenting, and trying again, I'll eventually get somewhere.

AI Helped Me, But It Didn't Do the Work For Me

I also learned something from using Claude during this process.

AI can be extremely useful when you're learning to code.

But there's a huge difference between using AI to learn and using AI to avoid learning.

If I had simply asked:

"Solve this assignment."

and pasted the answer into my project, I probably would have finished the assignment much faster.

But I would have learned much less.

Instead, I tried to use Claude more like a tutor.

Explain the concept.

Give me a clue.

Point me in the right direction.

Help me understand why something wasn't working.

Then let me struggle with the actual problem.

That struggle was important.

Because the moment I finally solved something myself, I understood it differently.

Four Weeks Later

After spending roughly four weeks working through loops and arrays, I can finally say that they make a lot more sense to me.

Not because I've memorized everything.

Not because I can solve every problem instantly.

But because I'm starting to recognize patterns.

I can read an assignment and sometimes already have an idea of the concept I need before I even start writing code.

And honestly, that feeling is amazing.

It's a small thing.

But when you've spent weeks being confused, that little moment of:

"Wait... I know what to do."

feels huge.

But I'm Not Done

I'm still working through The Odin Project.

I'm still learning JavaScript.

I'm still getting stuck.

I'm still breaking things.

I'm still asking questions.

And I still have a long way to go.

Four weeks of loops and arrays didn't make me a great programmer.

But it taught me something more important:

Understanding takes time.

Sometimes you have to read something twice.

Sometimes you have to fail at an assignment.

Sometimes you have to break your code.

Sometimes you need someone—or something—to give you a clue.

And sometimes you just need to keep going until the pieces finally start connecting.

So yeah...

JavaScript loops and arrays nearly broke me.

But they didn't.

I'm still here.

Still learning.

Still building.

Still growing.

And I've got a long way to go.

Let's see where this journey takes me. 🚀

Top comments (0)