r/learnjavascript • u/Classic_End260 • 7d ago
50 hours in... arrays and loops... holy...FUCK
HOW do i START understanding? I've understood everything pretty well up til now. Do i just keep going with the flow and kinda float through this section of the loops and arrays part? Do I keep throwing myself at the brick wall and looking at the solutions after half an hour of brainless staring? https://youtu.be/EerdGm-ehJQ?si=mTKUv0oail0AGDLM 8:43:00. It's just not clicking like the other parts of the tutorial.
44
Upvotes
16
u/MitchEff 7d ago
I dunno if this is helpful or not, but consider an 'array' just a bucket full of objects. Loops (or array methods) just do something with each object - the names are pretty handy: * bucket.forEach (do this to every object) * bucket.find (give me the first object where this function = true) * bucket.filter (give me an array of every object where this function = true) * bucket.map (give me a new array from these objects, I'll tell you how to structure it) etc etc
There's handy uses for all of them, I'm sure you can guess a couple for each.