Javascript For Loop and While Loop | Javascript Tutorial For Beginners

Поделиться
HTML-код
  • Опубликовано: 19 окт 2024
  • Check out my courses and become more creative!
    developedbyed.com
    Javascript For Loop and While Loop | Javascript Tutorial For Beginners
    In this video series we are going to learn modern javascript from scratch. This video is recommended for anyone wanting to learn javascript the modern way with ES2015. No previous programming knowledge is required, so this video series will help you learn javascript as your first programming language.
    We are going to take a look on how to create a foor loop, the modern and easy way using ES6. Another loop we can use is a while loop that takes a condition and it is going to run until the statement inside the while loop becomes false.
    Things covered in this video:
    How to create a for loop in javascript.
    How to create a while loop in javascript.
    📔 Materials used in this video:
    VSCode: code.visualstu...
    🛴 Follow me on:
    Twitter: / deved94
    Github: github.com/Dev...

Комментарии • 67

  • @reptarwillsmiteyou
    @reptarwillsmiteyou 4 года назад +23

    I'm doing my bootcamp right now and im struggling, but this is super super helpful!

    • @DanBauer
      @DanBauer Год назад

      Hey did you end up getting a job in the field? I’m currently struggling with my own bootcamp and am skeptical about things improving honestly.

    • @alihedayat325
      @alihedayat325 Год назад

      Did you finish your boot camp and are you working

  • @Wufyiofkes
    @Wufyiofkes 3 месяца назад

    I know I’m late, but as a beginner coder, I would say this is the most concise tutorial to follow. Thank you so much for making this 🙏

  • @nagy_noel13
    @nagy_noel13 2 года назад +1

    I'm having an IT exam tomorrow and this just saved me!!! thank you so much!!!!!

  • @nemesisx8320
    @nemesisx8320 4 года назад +34

    he wasn't kidding when he said it will go crazy ...

    • @williamalesna5703
      @williamalesna5703 3 года назад +1

      I experienced that and restarted my computer lmao

    • @creatorsbyexweiv
      @creatorsbyexweiv 3 года назад

      @@williamalesna5703 I need to try that out fast with R5 2600X

  • @sebipoiana1768
    @sebipoiana1768 2 года назад +9

    For those of you who got 'Uncaught TypeError: Assignment to constant variable' by copying his code, you need to add 'let' in front of name. The const is causing issues, because the array is declared as a constant and the name must be declared with 'let'.
    I am surprised he didn't get this error. If there is another way, I would be happy to know!

    • @snoopyrawr
      @snoopyrawr Год назад +2

      im surprised too i didnt get the error

  • @rohinisampath
    @rohinisampath 5 лет назад +8

    ur amazing dev

  • @44aliano
    @44aliano Год назад

    as clear as water, thank you man

  • @corneliuduna7252
    @corneliuduna7252 2 года назад +1

    Love that intro beat? Is it original or can i find it somewhere? Thanks

  • @peteryu4353
    @peteryu4353 5 лет назад +2

    Hi Ed, can you please explain the differences between for(let i = 0;.. vs for(i = 0;..? Why and when should I add a variable and when should I not? Thank you.

    • @adityakotian007
      @adityakotian007 5 лет назад +6

      if you have declared the variable outside the loop you don't need to declare it inside. So in this example for(let i=0) if you have declared that there is a variable name i inside the loop. you could have also written
      let i; // now you are declaring the in the start
      for(i=0;i

  • @Iamjoelangel
    @Iamjoelangel 4 года назад

    Thankyou bro ...got to understnad the basic os while and for loops

  • @hieuchu7115
    @hieuchu7115 Год назад

    Good video! Can you please tell me the name of the vscode theme? I love

  • @pedrocxbx
    @pedrocxbx 4 года назад +1

    You're the best man!

  • @badarkamil3974
    @badarkamil3974 5 лет назад +1

    awesome, would tell me that can we access to Aray by invoking the numbers. Thanks

  • @chriscorte6902
    @chriscorte6902 3 года назад +2

    well a lot of comments here seem to be thankful but I had no clue what you were talking about.
    it felt like you just started coding and didn't explain very well what you were doing. For example I didn't know why you created an array of strings, what an "of" statement is, or why you declared the "name" variable ahead of time. Then again, I might just not know enough yet.
    you explained the "===" operator very well but even then I had no idea why that worked because you declared NAMES, not NAME. you know, with an S. you do have a playlist for "JavaScript For Beginners" so you might just be pulling from that source.

  • @grigorfanyan1821
    @grigorfanyan1821 4 года назад +2

    THANK YOU. THIS IS THE BEST TUTORIAL

  • @serious6037
    @serious6037 2 года назад +2

    Can you make the same tutorial but with document.getElementById?

  • @cafe-tomate
    @cafe-tomate 3 года назад

    Hi Dev,
    I see you use name without declaring it const let or var.
    What will the "type" of name in this case as such ?

  • @priyanzhu
    @priyanzhu Год назад

    What was the intro music? Plz lemme know

  • @mohdhaseeb5155
    @mohdhaseeb5155 5 лет назад +1

    can you please tell name of song running in background in video starting and ending

  • @prabanch8204
    @prabanch8204 Год назад

    You are awesome💗

  • @fedus22
    @fedus22 4 года назад

    How can I get the index of the elements using the "of" syntax in the for loop?

  • @jipeejoce1353
    @jipeejoce1353 5 лет назад +5

    it gets false FROM 100, not 101 because the inequality is strict.

  • @codesetup265
    @codesetup265 3 года назад

    I think that javascript executes the code line by line but in the case of while loop without knowing the updation whether it is incremented or decremented how is it processing the code inside it? please solve my doubt here I stopped my JS course out there...

  • @zarifkarim953
    @zarifkarim953 4 года назад +1

    What video recorder did you use to make this vid?

  • @Tiago_Gun_Zalez
    @Tiago_Gun_Zalez Год назад

    Can you just called the for loop names?, like this:
    for (names) {
    }

  • @tomisinergy4963
    @tomisinergy4963 4 года назад

    I am dancing every time on the intro song.

  • @klaingarjosue
    @klaingarjosue 4 года назад +1

    beginner here, I had no problem running the code but I'd like to understand. You did loading++ at 6:16 , which makes loading's value go from 0 to 1. 1 is still < 100. So why does it work? I don't get how the value of loading is now more than 100

    • @chrisparsons289
      @chrisparsons289 2 года назад

      You've probably figured it out by now... but because loading++ is within the loop, after it confirms the condition is false it will go through the loop and then add 1 to the value of loading. It will do this over and over again (check the condition to see if it is true, if it is it will then add 1 to loading) until loading value = 100 at which point the loop will stop. This is because 100 is not less than 100 which makes the condition false, therefore stopping the loop.

  • @learntolove9223
    @learntolove9223 4 года назад

    wow excellent

  • @deansofic914
    @deansofic914 2 месяца назад

    "name is deprecated" why does it say that?

  • @gravitowl
    @gravitowl 4 года назад

    Why does
    for(name of names){
    console.log(name)
    }
    work but
    for(something of names){
    console.log(name)
    }
    doesn't?

    • @gravitowl
      @gravitowl 4 года назад

      @@narayadewe7979 did it work? as i tried some other things and it didnt

    • @gravitowl
      @gravitowl 4 года назад

      @@narayadewe7979 k!

    • @gravitowl
      @gravitowl 2 года назад

      @@capslock3250 yeah this was 2 years ago but i mreading this back now and i dont get why i didnt get that lol

  • @usmanzai8748
    @usmanzai8748 4 года назад

    console.log(i didn't find do loop) thank you so much

    • @fedus22
      @fedus22 4 года назад

      You don't really need that

    • @ahmdm2036
      @ahmdm2036 4 года назад

      Well you forgot the quotes. What a noop programmer

  • @compilations756
    @compilations756 3 года назад +2

    bro so much similarities to python wow

  • @andranikhovhannisyan3715
    @andranikhovhannisyan3715 4 года назад

    dhey guys whatsup ? can someone explaing ? so i did this and get that result 99 why?
    let loading = 1;
    while(loading < 100) {
    console.log("website stil loading");
    loading ++;
    }
    //and this example
    let loading = -1;
    while(loading < 100) {
    console.log("website stil loading");
    loading ++;
    }
    //the result is 101
    why it loops like that ?

    • @sergiuszrozycki
      @sergiuszrozycki 4 года назад +2

      You need to start from let loading = 0; then it will make 100 times to stop a loop.

  • @adamabusamra2447
    @adamabusamra2447 4 года назад +3

    Really appreciate you trying to explain the concept but to be honest, the video wasn't well structured. you jumped straight to ' for of ', you didn't even mention that it could be used without 'of' like -for (statement 1; statement 2; statement 3) - and then moved on to while loop and didn't even explain the syntax and the difference compared to 'for loop' and why use either one.

  • @GioFar
    @GioFar 2 года назад

    The first you show is a for...of Loop, not a for Loop as the title says.

  • @burr1to942
    @burr1to942 3 года назад

    I WAS THERE POGU

  • @T4yl4n1
    @T4yl4n1 4 года назад +1

    welp, everything went crazy...

  • @laurentaylor9579
    @laurentaylor9579 3 года назад

    Why $()? That part confused me

  • @martinmclean5985
    @martinmclean5985 4 года назад

    Peace!

  • @dr_corrupt1014
    @dr_corrupt1014 Год назад

    who has the name of burrito ? @developedbye? 😂

  • @zefnreaj3548
    @zefnreaj3548 4 года назад +1

    I blocked my PC twice o|o

  • @naveedasgari8415
    @naveedasgari8415 4 года назад

    why is my ${} not working?!

    • @SmilesByShreya
      @SmilesByShreya 3 года назад +3

      Use backticks instead of single quotes

  • @plw5522
    @plw5522 4 года назад +1

    Your screen texts are too small to view ☹️ comparing to other RUclipsrs'

  • @Human_Evolution-
    @Human_Evolution- 2 года назад

    Text too small

  • @jjguillermo6059
    @jjguillermo6059 2 года назад

    I ran the code and my PC melted

  • @mariuscrn4905
    @mariuscrn4905 3 года назад

    Good video! Can you please tell me the name of the vscode theme? I love it.