JavaScript Tutorial For Beginners #16 - While Loops

Поділитися
Вставка
  • Опубліковано 2 січ 2025

КОМЕНТАРІ • 86

  • @DIEZ919191
    @DIEZ919191 5 років тому +42

    I want to say (on the beginner rights) it's been very well explained compare to other sources! The most difficult part of learning javascript is to find a good source to learn from!

  • @jakubwozniak3089
    @jakubwozniak3089 7 років тому +12

    I am so happy I can cry right now.
    age++, the key that I was missing.
    I never realised that with (i=0; i

  • @tjmcpj
    @tjmcpj 3 роки тому +8

    I cannot begin to tell you how much this has helped as a supplement to my Odin Project/Freecodecamp curriculum. Thanks so much Shaun!

  • @offline._archive
    @offline._archive 5 років тому +6

    i was so confused on FreeCodeCamp.. Thanks for such a good vid!

  • @lycan2494
    @lycan2494 5 років тому +9

    dope video man... simple and very clear explanation! and i see u got active videos subbed

  • @drumlessbackingtracks
    @drumlessbackingtracks 6 років тому

    Nice and clear, cheers!

  • @michaelnsofwa3117
    @michaelnsofwa3117 6 років тому

    This is the Best JavaScript tutorial ever on UA-cam. Well constructed course structure for easy understanding. Brilliant educative step by step lessons for beginners. Well done mate. Thanks

    • @NetNinja
      @NetNinja  6 років тому

      Thanks so much man, much appreciated!

  • @666-l6j
    @666-l6j 8 років тому +3

    wow you solved my frustration! thanks! I've been stuck on the while loop for a while. great video!

    • @JeffkReina
      @JeffkReina 10 місяців тому

      I see what you did there 😂

  • @emmanuelashfaaqfuadjavascr4906
    @emmanuelashfaaqfuadjavascr4906 2 роки тому

    wow i am beginning to love this guy tutorials,i'm always trying to understand the while loop but your explanation made me understand it. Thank you so much Net Ninja

  • @dooogyyyu
    @dooogyyyu 8 років тому +3

    Clear and concise as always. Your videos are the best.

  • @skreemer02
    @skreemer02 6 років тому +4

    Best tutorials, Ever! Thank you so much!

  • @sanshubhkukutla7284
    @sanshubhkukutla7284 5 років тому +2

    Great tutorials man! Love the satisfying clicks of your mouse tho!

  • @alexandervandyke6640
    @alexandervandyke6640 2 роки тому

    Thanks for the video! I was completely stuck on how to do while loops prior to watching it!

  • @johnaldrineilao
    @johnaldrineilao 2 роки тому +1

    Thank you so much for this! Simple and clear explanation!

  • @leonardoragazini
    @leonardoragazini 3 роки тому +1

    I didn't understand the age++ part. To be more specific, I didn't understand how/when is this loop going to take place, exactly? You said if we don't use "age++" it will cause the computer to crash. But how/when exactly does that age change? In other words, how long does it take for this specific loop to "go around" ???
    Thanks a lot for the very useful tutorial. Im really enjoying it!!! Thank you!!!

  • @jluna231
    @jluna231 3 роки тому

    Simple enough. Am getting the hang of coding faster then I thought !

  • @brocklesnarufcchamp1
    @brocklesnarufcchamp1 7 років тому +1

    var enemies =10;
    while (enemies > 0) {
    document.write ("Engaging enemies!");
    enemies--;
    }
    document.write("All enemies destroyed");

  • @coolsweatz
    @coolsweatz 3 роки тому +1

    Man, can't thank you enough you explain things so clearly and well for me to understand ❤️

  • @s.k.7834
    @s.k.7834 4 роки тому

    Very clear explanation on while loops! Thank you for making it so clear!

  • @musicNix12345
    @musicNix12345 7 років тому +2

    1:22 That will crush your coumputer...so, I'll show you that in a second. :D
    Great videos, though! Thanks!

  • @infotainment999
    @infotainment999 6 років тому

    Omg your teaching just clicks for some reason, bravo!

  • @english_with_aga
    @english_with_aga 7 років тому

    Great tutorial - thanks for sharing!

  • @IsSheRG710
    @IsSheRG710 7 років тому +3

    Makes so much sense, thank you!

  • @Perdigaopreto
    @Perdigaopreto 4 роки тому +1

    Thank you for your vid! and what about while loop with if? I'm stuck on one...

  • @rogerm4a1
    @rogerm4a1 4 роки тому

    Thanks for explaining this! Saw that you are active as well and immediately subbed.

  • @TheFippe
    @TheFippe 7 років тому +8

    Best videos i have found on the subject, so simple a mare child could understand and that is exactly what you want with a guide. Started my way with codeacademy which was good but i get a much better understanding in a whole with these vids, recomended for everyone that are new to javascript! Big ups to this dude!!! Sub him, he deserves more.

    • @djhonz45
      @djhonz45 5 років тому

      Oh my word!! I just sent him a similar message and just saw yours! It’s so true!! I’m doing freecodecamp but I always end up here!

  • @ronnieljavier599
    @ronnieljavier599 6 років тому +1

    Better explanation than Colt Steele

    • @anyabrown9600
      @anyabrown9600 5 років тому

      Ronniel Javier yes! I was doing his Udemy course and I didn’t understand it until now.

  • @Tech-qy3yy
    @Tech-qy3yy 7 років тому +1

    YOUR VIDEOS HAVE HELPED ME SO MUCHHHH SO THANK YOU VERY MUCHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @yevgeniypak1220
    @yevgeniypak1220 3 роки тому

    Great and unique clarification. Thank you!

  • @talksister4496
    @talksister4496 3 роки тому

    Thank you very much for explaining it so simply

  • @user-iv7qo6dm5f
    @user-iv7qo6dm5f 3 роки тому

    Now I finally get it! Thanks a lot!

  • @pavlejovanovic7297
    @pavlejovanovic7297 2 роки тому

    Wow, m8, finally got it. Thanks for the perfect explanation.

    • @NetNinja
      @NetNinja  2 роки тому

      No problem, glad it was helpful Pavle 👍

  • @limjiayao
    @limjiayao 7 років тому +3

    Great video! You explain JS so much better than my professor. Anyway minor minor error spotted: I think the very last line of code should be
    document.write("You are now at least 10 years old!");
    since 10 is not over 10 haha. Cheers from Singapore!

  • @xaif3436
    @xaif3436 4 роки тому

    You are genius bro!

  • @mackd5308
    @mackd5308 6 років тому +17

    Ivan brought me here.

  • @vidhyaarul
    @vidhyaarul 9 місяців тому

    Wonderful man!! Excellant🎉

    • @NetNinja
      @NetNinja  9 місяців тому

      Thanks a lot! :) glad it was helpful

  • @Ezinma88
    @Ezinma88 2 роки тому

    I mean this could just be a for loop, right? I was hoping for maybe a while loop that's reliant on something being true or false. It was just hard to concentrate on under what circumstances I might use a while loop when it didn't feel necessary. If you see what I mean? I do think you explained things clearly in this particular example. But, I think I need to keep looking for examples.

  • @serispeaks
    @serispeaks Рік тому

    Thanks.
    How do you make a while loop for multiple conditions?
    Like a while loop for if age < 21 AND userDrinkSelection = alcoholic
    {
    then run some code
    }

  • @SurgicalScholars
    @SurgicalScholars 6 років тому

    Thanks bro, this was really helpful!

  • @hashimovknan6817
    @hashimovknan6817 8 років тому +1

    Hi , i really like watching your videos altought my english is not good enough to understand everything ur saying. can you add subtitles in turkish? i'm pretty sure all of your turkish fans will appreciate this and you will get more view. Thank you for attendion.

  • @ardypangihutan3653
    @ardypangihutan3653 Рік тому

    I wished this tutorial on the top of 'while loop javascript tutorial' keyword search. we are overcrowded with long and complicated videos

  • @virtuevinyo9777
    @virtuevinyo9777 8 років тому

    The Net Ninja what text editor you using??

  • @cromuelbarut9859
    @cromuelbarut9859 6 років тому +2

    what is the difference between "for loop" and "while loop"?

    • @AniSepherd972
      @AniSepherd972 6 років тому +3

      While loop is used in situations where we do not know how many times loop needs to be excuted beforehand.
      For loop is used where we already know about the number of times loop needs to be excuted. Typically for a index used in iteration.

  • @getintosuccess8198
    @getintosuccess8198 5 років тому

    love your videos

  • @chriskissoon
    @chriskissoon 8 років тому

    Hey net ninja please correct me if I'm wrong but if age is equal to 10 wouldn't the document.write message be wrong Since 10 is not less that 10

  • @rowanking7885
    @rowanking7885 4 роки тому

    YAY I FINALLY UNDERSTAND!

  • @abhi.shah__
    @abhi.shah__ 4 роки тому

    When & why to use console.log & Document.write & difference between them please reply
    I am watching currently whole playlist of JS

    • @pallavi5441
      @pallavi5441 4 роки тому +2

      console.log will write on the console on the side whereas document.write will write on the browser.
      Here also, you can use document.write instead of console.log but then it will print " your age is less than 10" five times on the browser.
      There are no necessary conditions in which to use the console.log. You can use it if you don't want the viewer to see something, then you can get it to print on the console using console.log.
      the net ninja answered a similar question in the comments. here it is:
      Mortdecai Rigby
      What is and in what circumstances console.log is usable?
      The Net Ninja
      Hey, you'd use it maybe to debug your JS as you're working on something, to check the value of a variable, or just to test the functionality. It comes in handy :)
      hope this helped :)

  • @ericsolheim2478
    @ericsolheim2478 6 років тому

    What's the difference between a while-loop and a for-loop?

  • @M.Code03
    @M.Code03 5 місяців тому

    Can't we use ++age to make it much easier and better, using age++

  • @jonthuemichel7670
    @jonthuemichel7670 8 років тому

    Thanks! it really was helpful!

  • @kirose7236
    @kirose7236 4 роки тому

    What if you want to multiply it by 2 for example how would you do that?

    • @vdeschuy190
      @vdeschuy190 4 роки тому

      Do you mean multiply the age variable by 2 every iteration?
      That would be: age *= 2;

  • @wrizuuchhetri3609
    @wrizuuchhetri3609 4 роки тому

    hey ninja wen to use while-loop please rply

  • @ericshi6427
    @ericshi6427 6 років тому +1

    what does this do again?

  • @serapheva
    @serapheva 4 роки тому

    how would you double a variable every 7 days?

  • @lonw.7016
    @lonw.7016 6 років тому

    I remember in Messenger on Yahoo. The alert box loops. hmmm.

  • @khusarifkhanov1123
    @khusarifkhanov1123 6 років тому

    What is and in what circumstances console.log i usable?

    • @NetNinja
      @NetNinja  6 років тому

      Hey, you'd use it maybe to debug your JS as you're working on something, to check the value of a variable, or just to test the functionality. It comes in handy :)

  • @aqeemjones
    @aqeemjones 3 роки тому

    YO WHATS GOING ON GUYS!! NET NINJA FAMILY!! LETS GO!

  • @Anveshana837
    @Anveshana837 7 років тому

    can you please tell how you run the code in chrome?

    • @JurajPecháč
      @JurajPecháč 7 років тому

      Ashwini Abhishek Open an HTML file and select File > Live Preview ( or click the "lightning bolt" icon). Brackets will launch Chrome and open your file in a new tab.

  • @mr.RAND5584
    @mr.RAND5584 4 роки тому

    I need this to delete all rows of table.

  • @shafyaalmuhari9520
    @shafyaalmuhari9520 3 роки тому

    great tutorial but please can you tell how to do it in notepad

  • @AleksaCar-bk1rx
    @AleksaCar-bk1rx 3 роки тому

    Thank you

  • @misirali2584
    @misirali2584 2 роки тому

    We can do that by if else.

  • @ginger-viking
    @ginger-viking 7 років тому

    Northern accents are oddly appropriate for voices of authority (I'm southern).

  • @MustafaBirsoz
    @MustafaBirsoz 3 роки тому

    nice

  • @nomad8095
    @nomad8095 4 роки тому

    But what about those age

  • @hosamabdulmaged2936
    @hosamabdulmaged2936 5 років тому

    Oct 16, 2019

  • @rejuzaman6365
    @rejuzaman6365 10 місяців тому

    🔝

  • @nusratkabirkhannishu6397
    @nusratkabirkhannishu6397 4 роки тому

    Thanks bro.. May Allah bless u..

  • @nazanin_ashrafi
    @nazanin_ashrafi 2 роки тому

    thank you

  • @cryptooten3588
    @cryptooten3588 6 років тому

    Ivan brought me here.