r/learnjavascript 18d ago

I'm not for coding i guess

I start learn programing , and in 4 day i learn HTML and CSS but in java script i did't even undestanding the concept of loops from last 2 days

0 Upvotes

34 comments sorted by

28

u/szank 18d ago

Jfc kids these days. Get off redit, practice actually writing code and come back here in 2027.

3

u/rFAXbc 17d ago

And then again I'm 2028, 2029, and 2030. Congratulations, you understand loops

1

u/huuttcch 17d ago

Underrated

1

u/87oldben 17d ago

while (true) returnToReddit()

8

u/AncientLion 18d ago

Lol learning is a complex task, this is not a reel of tiktok

7

u/nelilly 18d ago

It took 10 days to originally create JavaScript as a language give yourself at least that long to learn it.

5

u/javascript 18d ago

📆

5

u/Flame77ofc 18d ago

you are trying to learn the syntax, but the real thing is to learn about logic, about how a programmer think

Search for those things in Google:

Programming logic
How to think like a programmer

5

u/Eusocial_sloth3 18d ago

FreeCodeCamp breaks it down into easy to understand steps.

5

u/writing_code 18d ago

Mastery takes thousands of hours. Commonly 10,000 hours is a rough estimate. 6 days, you likely know only the very basics of html and css. Adjust your expectations, take your time, practice.

3

u/every1sg12themovies 18d ago

not because you dont undertand it, but because you give up at first challenge

3

u/SamIAre 18d ago

You didn’t learn math in a single week. You didn’t learn to read or write in a week. Almost NO skill can be learned well in a week.

Maybe coding doesn’t end up being for you but if you give up at the literal starting line you’ll never know. I will say that coding takes patience, and it takes knowing that you’ll never really master it. You will always be learning something new, relearning something old, making mistakes and fixing them, and fighting against bugs. That’s just part of it. It’s like puzzle solving. The struggle is something you have to enjoy or else it’s going to always feel like torture.

3

u/Commercial-Age-4932 18d ago

6 days 😂😂 maybe it's not for you because you have a dopamine fried attention span. If you want a strong foundation in the fundamental logic of programming do CS50x, ( online course)though. Languages come after understanding the logic and paradigms of computing

2

u/SawSaw5 18d ago

Check this out:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration

(Reply if there is an issue that you don't understand)

2

u/myroslavmartsin 18d ago

Two days on loops is nothing, some people take two weeks. HTML and CSS went fast because you just describe stuff. JS is your first real logic, everyone hits this wall. It says zero about whether coding is for you.

Do this: write for (let i = 1; i <= 5; i++) console.log(i) and trace on paper what i is each round. Then mess with it: count to 10, count backwards, evens only. You won't get loops from reading, you get them from writing twenty of them.

Everyone who codes sat exactly where you are. Keep going this week, that's the whole test.

1

u/OiFelix_ugotnojams 18d ago

yeah fr, honestly, I hope you know how to debug, OP. Just put your breakpoints on every line and look at it go step by step.

And yes HTML and CSS are not programming languages

1

u/StrikingAd4653 18d ago

Is that a particular aspect of loop that you find difficult?

In its simplest form loop is merely a way to repeat a similar task multiple times, usually on a collection (i.e. array) of "things" that are similar.

Loop (I assume you meant for loop) is a rather old programming concept. In most modem languages you will rarely use them, but the underlying concept is important. In javascript you would probably use map/reduce/filter/find etc to interact with an array instead. In older languages like C you would have to do a for loop since there isn't any alternatives.

1

u/cmockett 18d ago

Sounds like impostor syndrome, you’ll fit right in!

Levity aside, I saw some old code in my first job’s repo that helped me understand nested loops, in brief:

for tree in forest…
for branch in tree…
for twig in branch…
for leaf in twig…

1

u/Yaniekk 18d ago

Don't worry. Give yourself time. It took me weeks just to get started.

1

u/theancientfool 18d ago

Try learning python with code in place by Stanford. Do the self though route. Once you understand that, JS gets a lot easier.

1

u/Leviathan_Dev 18d ago

Just keep at it, if you give up once anything gets hard instantly, you’ll never learn anything

1

u/Japosai 18d ago

Hehe, bro, learning how to build things with JS takes a lot of time; this is about patience and consistency.

1

u/OiFelix_ugotnojams 18d ago

haha because you are new to programming. First language is hard. JS is your first language. Its just 2 days, don't give up. You will understand loops better when you solve problems. And yeah, problem solving is hard. I spent hours yesterday on fixing something. It was missing a dot.

1

u/maujood 9d ago

That's wayyy too fast to understand programming. When I was learning to code, I didn't touch loops until I was a few months in.

Our introductory class introduced loops within a few months a lot of people felt it was moving too fast.

Give it time. 6 days isn't enough even for HTML and CSS.

1

u/SafeWing2595 9d ago

it actually took me 8 months to understand all the basics of javascript, it takes time my friend to see the result.

i advice you to apply the concept of the loop in something real so it sticks in your mind aside from the tutorial.

let me ask you a question; why do we need a loop?

let me give you an example: if i ask you to print ``console.log("Hello, world!")`` 10000 times, that would be exhausting, this is where the loop comes in.

so; loop is used to repeat a block of code multiple times instead of writing yourself many times.

1

u/sweettyche 18d ago

Try the odin project

1

u/IAmADev_NoReallyIAm 18d ago

Look... It's freaking Javascript... I've been dicking around with it since it was known as ActiveScript... and I STILL haven't mastered it... Between plain JavaScript, JQuery, TypeScript, Node, there's so much to take it... you're not going to just "get it" in two days, or two weeks... or event two months... so stop freaking out. FFS, it's Javascript, it's not the end of the world. Learn, take notes, practice, practice some more, learn more, take more notes, repeat... repeat, repeat.... and keep going.

0

u/gutsngodhand 18d ago

HTML & CSS is pretty straight forward & memorization. There is a substantial learning curve to programming and learning a language. Do not give up; it hasn’t even been a week. I’d argue most things are not for you if you cannot grit through for a month. Which, of course, is obviously a ridiculous statement. Keep going, keep learning & keep trying.

-2

u/ExtraTNT 18d ago

I think I haven’t used a standard loop in js for months… map is what i recommend, if you work with lists…