Review (Hope this helps)


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-ASGIv/2/4?curriculum_id=506324b3a7dffd00020bf661

I see a lot of post topics from people that don't really understand what they are doing wrong. Personally, I found the instructions/text vague, no matter how many times I read it. When I get stuck I still look in the forum to see the question and the answers; I read through the whole thread and find it useless. Maybe its just me, but it seems that the "Help Desk" people mostly just give you a link to read (being to lazy to explain what they did wrong?) then it seems even that is more confusing & more complicated for myself and many other newbies. Most of the time I get better help from a youtube video, so this is for all the people that are confused by the overcomplicated answers that are given to them. 'cause sometimes a dumbed down answer helps more.


//  FOR LOOP
for (var one = 1; one <= 3; one++) {
    console.log(one);
}

/* here variable one = 1, one is less than or equal to 3, one++ will add
1 to every time the console prints.. should print: 1, 2, 3*/




// WHILE LOOP

var one = 1;

while (one <= 20) {
    console.log(one);
    one += 5;
}

/* starting with variable one = 1, the while loop starts 
with one is less than or equal to 20. the console then 
prints what "one" is, PLUS adding 5 to it every time its printing.
should print... 6, 11, 16 */




// DO LOOP

var one = 1;

do {
    console.log("HOWDEY")
} while (one > 2);

/*starting with variable one equaling 1, 
the DO loop has to print the block code inside the {}. 
which is "HOWDEY". now the  WHILE says that one 
needs to be greater than 1 (which is not, 1 is less than 2).
the console will print "HOWDEY" then it will stop because the WHILE
IS FALSE*/

I hope I helped someone out there. I'm not giving you the answer, I'm showing you how it can be done, hopefully, you can learn and do it on your own. coding shouldn't be so hard and over complicated it sucks the fun out of it, i do think it should be challenging and mind blowing. thanks for reading, let me know what you think.


#2

// WHILE LOOP
should print... 1, 6, 11, 16 and not 6, 11, 16

Sorry if I have to say so but programming can also hurt sometimes.
You have to be willing to learn again.

This means in my eyes if someone gives you a link to teach you the necessary knowledge, he makes it for a certain reason.

In this case, I would not know how to explain it better than in these examples. Here you have the explanation and immediately examples and you can thereby teach yourself.

MDN - for
MDN - do ... while
MDN - while

And please do not forget the most of the help here is voluntarily

If you look at this links what do you miss ?


#3

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