Javascript For Loop and While Loop | Javascript Tutorial For Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2019
  • 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.visualstudio.com/
    🛴 Follow me on:
    Twitter: / deved94
    Github: github.com/DevEdwin
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 66

  • @Wufyiofkes
    @Wufyiofkes 16 วันที่ผ่านมา

    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 🙏

  • @nemesisx8320
    @nemesisx8320 4 ปีที่แล้ว +31

    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

  • @nagy_noel13
    @nagy_noel13 2 ปีที่แล้ว +1

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

  • @reptarwillsmiteyou
    @reptarwillsmiteyou 3 ปีที่แล้ว +20

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

    • @DanBauer
      @DanBauer 11 หลายเดือนก่อน

      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 11 หลายเดือนก่อน

      Did you finish your boot camp and are you working

  • @rohinisampath
    @rohinisampath 4 ปีที่แล้ว +8

    ur amazing dev

  • @pedrocxbx
    @pedrocxbx 4 ปีที่แล้ว +1

    You're the best man!

  • @sebipoiana1768
    @sebipoiana1768 2 ปีที่แล้ว +8

    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

  • @Iamjoelangel
    @Iamjoelangel 4 ปีที่แล้ว

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

  • @44aliano
    @44aliano ปีที่แล้ว

    as clear as water, thank you man

  • @badarkamil3974
    @badarkamil3974 5 ปีที่แล้ว +1

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

  • @prabanch8204
    @prabanch8204 ปีที่แล้ว

    You are awesome💗

  • @learntolove9223
    @learntolove9223 4 ปีที่แล้ว

    wow excellent

  • @mohdhaseeb5155
    @mohdhaseeb5155 4 ปีที่แล้ว +1

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

  • @fedus22
    @fedus22 4 ปีที่แล้ว

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

  • @grigorfanyan1821
    @grigorfanyan1821 3 ปีที่แล้ว +2

    THANK YOU. THIS IS THE BEST TUTORIAL

  • @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

  • @cafe-tomate
    @cafe-tomate 2 ปีที่แล้ว

    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 ?

  • @hieuchu7115
    @hieuchu7115 ปีที่แล้ว

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

  • @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...

  • @jipeejoce1353
    @jipeejoce1353 5 ปีที่แล้ว +5

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

  • @corneliuduna7252
    @corneliuduna7252 ปีที่แล้ว +1

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

    • @priyanzhu
      @priyanzhu ปีที่แล้ว

      I need it too

  • @tomisinergy4963
    @tomisinergy4963 4 ปีที่แล้ว

    I am dancing every time on the intro song.

    • @abdul391_
      @abdul391_ 4 ปีที่แล้ว +1

      same 😁😂

  • @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 3 ปีที่แล้ว

      Well you forgot the quotes. What a noop programmer

  • @serious6037
    @serious6037 ปีที่แล้ว +2

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

  • @priyanzhu
    @priyanzhu ปีที่แล้ว

    What was the intro music? Plz lemme know

  • @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.

  • @zarifkarim953
    @zarifkarim953 3 ปีที่แล้ว +1

    What video recorder did you use to make this vid?

  • @mariuscrn4905
    @mariuscrn4905 3 ปีที่แล้ว

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

  • @klaingarjosue
    @klaingarjosue 3 ปีที่แล้ว +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.

  • @compilations756
    @compilations756 3 ปีที่แล้ว +2

    bro so much similarities to python wow

  • @Tiago_Gun_Zalez
    @Tiago_Gun_Zalez 10 หลายเดือนก่อน

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

  • @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

  • @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.

  • @martinmclean5985
    @martinmclean5985 4 ปีที่แล้ว

    Peace!

  • @burr1to942
    @burr1to942 3 ปีที่แล้ว

    I WAS THERE POGU

  • @T4yl4n1
    @T4yl4n1 4 ปีที่แล้ว +1

    welp, everything went crazy...

  • @GioFar
    @GioFar 2 ปีที่แล้ว

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

  • @adamabusamra2447
    @adamabusamra2447 3 ปีที่แล้ว +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.

  • @laurentaylor9579
    @laurentaylor9579 3 ปีที่แล้ว

    Why $()? That part confused me

  • @dr_corrupt1014
    @dr_corrupt1014 ปีที่แล้ว

    who has the name of burrito ? @developedbye? 😂

  • @zefnreaj3548
    @zefnreaj3548 4 ปีที่แล้ว +1

    I blocked my PC twice o|o

  • @Human_Evolution-
    @Human_Evolution- 2 ปีที่แล้ว

    Text too small

  • @plw5522
    @plw5522 4 ปีที่แล้ว +1

    Your screen texts are too small to view ☹️ comparing to other TH-camrs'

  • @naveedasgari8415
    @naveedasgari8415 4 ปีที่แล้ว

    why is my ${} not working?!

    • @wanderBliss2530
      @wanderBliss2530 3 ปีที่แล้ว +3

      Use backticks instead of single quotes

  • @jjguillermo6059
    @jjguillermo6059 2 ปีที่แล้ว

    I ran the code and my PC melted