Always get frustrated at this point


I always get frustrated at this point of the javascript lessons. This'll be my second go around with javascript and everything seems beautiful and understandable until I reach the "Search text for your name," and I get overwhelmed by the amount of variables and which variable is doing what with who and which is an array, how every string is also an array and I end up feeling really stupid.

I then assume there's no point in squeezing through to the end if i'm having difficulty with the beginning of the lessons since I assume it will be getting much more confusing and I don't really have any projects I can think up to incorporate what i've learned.

Anyone have any tips to help wrap my head around nestled loops, variables inside variable that are equal to other variables, and are there better more clean ways to search text and is this just a learning tool which I just have to sweat through and never see again. I'm sure I can finish the assignment but I dont feel like I would've learned anything and will just be hitting "Give me a hint," everytime until the end.

Any help would be appreciated, like how to think about those issues or simple projects that would lead me up to it or even external resources that prepare me for this variable/nestling dump.


Just get through it, and it gets easier and less chaotic later on.


add console.log() statements to see what your code is actually doing.


In the second "for" loop why do I have to make a new variable that is equal to i? Wouldn
t it be simpler to just use "i" since that loop only starts if "text[i] ===" the first letter of my name?

for (var i = 0; i < text.length; i++){
if ( text[i] === "S"){
for(var j = i; ; )


if you think that is simpler, you can try. I would personally stick to the instructions


Thanks, you have no idea how much I needed to know that. I was picturing the Dante's Inferno of coding where each level just adds more variable and loop nestling until I either have to make javascript my first language and have to translate my thoughts from javascript to english, or go insane


I actually found it simpler to call i something else. :smirk: But I'm glad that you feel comfortable enough to make personal modifications to improve you syntax.


I appreciate the Divine comedy reference. Honestly the way I see it is if you can see a way to use what you are trying to learn, then make sure you know how to use it. But if some thing seems useless and makes no sense to you than don't dedicate as much time to figuring it out. obviously don't give up, I'm not trying to say "All hope abandon, ye who enter in!" but if you don't see a practical use for something then don't get so bogged down in the details that you are basically stuck underground with your feet sticking out. okay sorry I had to. but on a serious note take objects as an example that you will learn later on in the course. there are two ways to make an object, so don't waste too much time memorizing both. Memorize the one you like and move on. this may not sound like good advice but its kinda how I did it. I can figure out how to make a switch case statement if the situation requires it but I wont use them as often as an if/ else if/ else statement or anything else. maybe that's just me but if you ever need to refresh a concept you can easily go back and relearn it from the course. this way you can cover all of the class but you don't have to memorize everything.


if you haven't read the Divine Comedy I will sound like an idiot in the previous post. if you have read it than you are probably facepalming right now. :raised_hand: :expressionless: :clap:


Thank you good sir! I suppose it wouldnt hurt to start making an html/css website so that when I learn how to incorporate javascript I can learn more by doing.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.