Modern JavaScript Tutorial #3 - Control Flow

Поделиться
HTML-код
  • Опубликовано: 5 авг 2024
  • 💻 Get the full Modern JavaScript (novice to ninja) course from Udemy. Discount auto applied:
    www.thenetninja.co.uk/udemy/m...
    In this modern JavaScript tutorial we'll take a look at different ways to control the flow of our code - for loops, while loops, if statements, else if statements, switches and more.
    ----------------------------------------
    🐱‍💻 🐱‍💻 Course Links:
    + Course files - github.com/iamshaunjp/modern-...

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

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

    It's one thing to know coding, It another to know how to teach it. You have it all.

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

      Thanks for the kind words Segun :)

  • @impressi5697
    @impressi5697 4 года назад +33

    For the very first time in my life, I can say I understand loops

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

      I feel you man i feel you

  • @ojikutuhakeem3106
    @ojikutuhakeem3106 2 года назад +22

    You are incredibly amazing, with the way you explain and make JS look too easy. I bless the day I came across your tutorials. Thank you. I hope you're doing ok.

  • @ashleysaleem-west5485
    @ashleysaleem-west5485 5 лет назад +25

    Fantastic, you really know how to make things entirely new concepts stick in just a few simple sentences.

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

    I watch so manny of your tutorials when i hear your voice it bring me smile ( i am not gay )

    • @lewisjones284
      @lewisjones284 4 года назад +70

      Thank you for clarifying that you aren't gay

    • @wissa_
      @wissa_ 4 года назад +27

      Well, you are now

    • @randomtestuser_
      @randomtestuser_ 4 года назад +4

      @@lewisjones284 HAHHAHAAHHAHAHAHA

    • @saweranabi7786
      @saweranabi7786 4 года назад +6

      Hi Tomi, If you are not a gay, then according to this video, let me apply on you, LOOP, first a "for loop" and again and again a while loop, or maybe "if" and "else if" cases.
      hahaha

    • @labamap364
      @labamap364 4 года назад +8

      click lewis jones name to see what he has watched
      ... drill gay wut the

  • @tamellahajiyeva3007
    @tamellahajiyeva3007 4 года назад +20

    Thank you for the tutorials. You give such a clear explanation on every topic!

  • @mqh20
    @mqh20 10 месяцев назад

    This has to be the best channel to learn any js concept and even has videos on react/nextjs. And the way you explain it just makes sense unlike some other channels which overload us with jargon without explain what it means. Thanks for this course it has helped clear some of the main concepts of js and now I can move onto react and nextjs.

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

    'For loop' explenation was just amazing. Thanks a lot! :)

  • @violet-trash
    @violet-trash 5 лет назад +7

    YES! I've been waiting for this since the last one yesterday!

  • @itshan3014
    @itshan3014 2 года назад +6

    What an amazing tutorial ! The way you explain is straight to the point and very easy to understand! Thank you so much for such incredible free JS courses!

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

      No problem Han :) glad you enjoyed it!

  • @AndyPerry1972
    @AndyPerry1972 2 года назад +7

    Well it's been a while but now back watching your excellent videos again as I want to get back in to coding after my degree!
    I have also just done something I have been meaning to do for a while now, and I have just subscribed to your Net Ninja Pro. Looking forward to these as I try to come somewhere near to a ninja! 🙂 I love your teaching style and everything just starts to make sense.
    Thanks Shaun and keep up the great work!

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

      Thanks for the support and kind words Andy :) means a lot. Glad to help!

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

    I'm straight but this man's voice is one of the reasons this is my preffered channel for dev tutorials

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

    Thanks for you'r tutorials. You always give me a clear explanation .

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

    Get the full course here - www.udemy.com/modern-javascript-from-novice-to-ninja/?couponCode=NINJAYT

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

    again and again, the best online coding tutor ❤

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

    Best JavaScript Tutorial, I bought the full course and it is excellent ! , Arrigato Net Ninja San !

  • @ghost_monacodm6362
    @ghost_monacodm6362 11 месяцев назад

    This is best JavaScript teacher I have ever seen on RUclips. You explained thoroughly and I understand every bit of it. Thank you very much for this video

    • @NetNinja
      @NetNinja  11 месяцев назад +1

      That means a lot, thank you :)

  • @andrewcbuensalida
    @andrewcbuensalida 4 года назад +10

    The Khan Academy of Coding! You're a legend!

  • @rizanmrm
    @rizanmrm Год назад +1

    Youre the best teacher I have seen in RUclips. Thank you for the amazing work Shaun

    • @NetNinja
      @NetNinja  Год назад +1

      Thanks Rizan, that means a lot :)

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

    Thank you so much for all contents what you share.
    Greetings from Brazil!

  • @Vincent1990-l1y
    @Vincent1990-l1y 3 года назад +1

    I like how this guy explains evverything, amazing!

  • @jensv8859
    @jensv8859 2 года назад +6

    Dude you are already a legend. Helps me so much!

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

      Glad to hear it! :) thanks for watching

  • @chinedujonathan4238
    @chinedujonathan4238 Месяц назад

    This video helped me understand more about Control flow.
    Thank you!

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

    Net Ninja and Telusko is my both perfect tutor ✌️✨ The way they explain thing is perfect ✨🎉

  • @agataa.8411
    @agataa.8411 Год назад

    I was looking for the step by step tutorial for very beginners like me. And, finally, I've found it! Thank you! Thank you so much! It is just what I need!

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

      You're so welcome! Hope it's helpful :)

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

    You helped me get a good paying job. Thank you.

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

    Great stuff! My only critique would be not to hide the console while you're working on the code- there seems to be plenty of room to show both at the same time. Thanks for this!

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

    Controlling the flow is super helpful 🔥 use conditionals evety day.

  • @user-em9kt2xc1b
    @user-em9kt2xc1b 2 года назад +1

    Well explained and make things clear to beginners, thx!

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

    I wasn't aware that Shaun was a character option in Street Fighter, but I think I know why. Shaun is a ninja, and a good one at that. So good, in fact, that I couldn't even find him on the character menu. Well played, sir, well played.

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

    Now we have a new ninja to play with "chun-li" 😉😉.
    Thanks buddy,
    Greetings from Tanzania 🇹🇿

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

    You are an excellent Instructor.

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

    Thank you~ Best coding teacher on RUclips. T_T

  • @kennedymusyoki751
    @kennedymusyoki751 Месяц назад

    Helpful tricks to get started with JavaScript journey.

  • @barkhadawil9689
    @barkhadawil9689 Год назад +1

    Thanks Shaun your tutorial helped me a lot, you are truly amazing person, God bless you.

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

    this video helped me to understand the reason why do i need to use let and const instead of var

  • @theblessedcoder
    @theblessedcoder Год назад +1

    You're a great teacher, thank you for simplifying these concepts..
    Do you have a course on data structures and algorithm?

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

    Thanks a lot, man u get me on the tracks

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

    great series of tutorials. very helpful and informative. thanks

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

      You're very welcome!

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

    Your videos are great! Keep up the great work! :-)

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

    this video has helped me out alot thanks

  • @sneharaj3191
    @sneharaj3191 6 месяцев назад

    Thank you so much for this lessons.....you are really a great teacher 🙏🙏

    • @NetNinja
      @NetNinja  6 месяцев назад

      Thank you! 😃 hope you found it helpful

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

    So Shaun, is it possible us to use the first defined "Age" variable inside 2nd code block when we actually define another "age" variable inside 1st code block? Would like to hear an answer, very good video.

  • @johnconnor9787
    @johnconnor9787 5 лет назад

    Do scope rules never worked for variables declared with the VAR keyword in, for example, ES5?

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

    Good Tutorial As Always ❤️😎

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

    Thank You very much sir
    Subscribed with Joy

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

    Thank you for these helpful videos

  • @PT-Tl1
    @PT-Tl1 4 года назад +1

    Bought the course!!!!! Thanks for making the course.

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

      Thanks so much, hope you enjoy it! :)

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

      The Net Ninja : Yes, it’s really very nice. Thanks for making such fantastic course.

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

    in the variables and block scope lesson, when you console.log the name outside of the block, shouldn't it have been undeclared?

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

    You sir have a loyal subscriber now.

  • @GisellyRock
    @GisellyRock Год назад +1

    Very nice!

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

    Can you make full crash course for tenserflow. Js big thanks keep up the good work!

  • @ShandesPresents
    @ShandesPresents 3 года назад +10

    7:41
    Ninja: Does that make sense?
    Me: No, not really...
    Ninja: Cool!

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

    I was so nervous having to learn a new language, especially all the web dev languages (which as a C programmer is a terrifying prospect) but all this makes me VERY happy! I just had to learn LUA and it was a nightmare, what an awful language. at least JS, though it has its problems, follows reasonable syntax. Just watching this playlist on 2x speed, and slowing down when something is different to C, lol

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

    You are the best my sifu ! ;)

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

    15:45 or you could just do "while(i

  • @oilblog1460
    @oilblog1460 5 лет назад +4

    Hello there.. your tutorials are very good. I have enjoyed them so far. Do you have a book..or an ebook covering what you cover on here..?

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

      Hey its just tutorials, no book!

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

    Point of note at 48:50: The reason the variable 'name' does not show undefined is because it is accessing the global window objects namespace word of 'name' which is currently blank.

  • @adamtak3128
    @adamtak3128 5 лет назад

    Awesome! Any plans on making vids on CRUD and Dom manipulation?

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

    I think that seeing pink at the start of his videos relaxes my nerves into thinking its easy

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

    Nice! Thanks

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

    hey please could you do a tutorial on data structures and algorithms in javascript? THANK U!!!

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

    hey ninja,can you tell me with waht console.log helps me? i mean,i do not get it

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

    it would great if there is an outline in the description for long videos. thanks

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

    Hello Net Ninja, how can I get this for $9.99 the coupon code not allow me to do that. Is there another code I can use.?

  • @OnlineCashFlowZone
    @OnlineCashFlowZone 8 месяцев назад

    Easy to understand, perfect💌💌 tutorial #The Net Ninja🤟🤟

    • @NetNinja
      @NetNinja  8 месяцев назад

      🙌 Thank you!!

  • @MrNeogoyal
    @MrNeogoyal 5 лет назад

    Hey Shaun! Please make a video on MVC Architecture in JS

  • @ibrahimalmuseimi164
    @ibrahimalmuseimi164 10 месяцев назад +1

    Fantastic, you really know how to make things entirely new concepts stick in just a few simple sentences , but i have a question in 51:31 you change from let to const how to do that in the same time

    • @markovincic4386
      @markovincic4386 9 месяцев назад

      put your pointer/cursor behind them by using ctrl+LMB and select them all, then delete and write a new word :)

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

    Thank youu!!

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

    Net ninja best of the best

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

    Finally someone explains what a global is without using a buncha jargon that makes no sense

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

    14:56 when i put " ; " at the end of line 12 and 13 i get error that says: " , " expected. Why is that so? VS Code tells me to use comas instead of semicolons

  • @kadamizu
    @kadamizu 5 лет назад

    really great course, helped me alot!

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

    excellent

  • @donow4633
    @donow4633 5 лет назад

    Awesome ! Arigato

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

    Hello Net ninja I really love your courses. Is there any coupons you can share for your selenium with Java course on Udemy. I am really interested in learning that.

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

      Hey Jennifer, the link below has the discount auto applied, hope you enjoy the course :D
      www.thenetninja.co.uk/udemy/modern-javascript

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

    thanks alot..

  • @paakofibamfoquaicoe4193
    @paakofibamfoquaicoe4193 5 лет назад +4

    Thanks Mr Ninja🧛‍♂️

    • @paakofibamfoquaicoe4193
      @paakofibamfoquaicoe4193 5 лет назад

      Please, have been trying to download the files from github but i can't access it...any help🙆‍♂️

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

      Hey - have you selected the correct branch for each lesson, as shown in the first video? After that you just click on the big green 'dowload zip' button.

  • @TheGryphon14
    @TheGryphon14 4 года назад +5

    48:50 Shaun, I wonder why didn't you get "Uncaught ReferenceError: name is not defined" on line 10

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

      Yeah, that was weird. An explanation might be found here: developer.mozilla.org/en-US/docs/Web/API/Window/name

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

      In java script if u don't declare variables but try to use them like he did at 48.50.. java script automatically creates new variable and assigns null to it. That's the reason we don't see any error here

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

      @@maurov2104 right... I forgot that Window.name exists

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

      @@vidyanath16 there's no such thing. It's actually because window has "name" property

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

    Hi!
    Thank You for the course!
    I have a problem with "continue"- everything works, but zero still appears in the console(
    let scores = [25, 50, 0, 30, 100, 90, 40];
    for (let i = 0; i < scores.length; i++) {
    console.log(scores[i]);
    if (scores[i] === 0) {
    console.log("next!");
    continue;
    }
    if (scores[i] === 100) {
    console.log("Congrats! you have made it!");
    break;
    }
    }
    I checked everything, but i don't see my mistake.
    Could you, please, tell me what is wrong?)

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

      you have console.log(scores[i]); before the code block checking for zero

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

      @@bonniethuku241 Thanks for you help!)

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

    Hi !! Shaun Please tell me the discount on this javascript udemy course i wanna buy it Right now

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

    It would be cool if you could create another gigantic course on Udemy, which covers all topics on modern CSS and HTML

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

    Owoaahhhhhhhh
    Dude,
    Your tutorial is awesome !!!
    JavaScript is no longer tough !!!
    Keep adding KUNG FU VIDEOS !!!

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

    Please post the other part of the course also from udemy !

  • @ahmadmahadi8827
    @ahmadmahadi8827 9 месяцев назад

    The main benefit of scope is to avoid naming conflict.

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

    Wouldn't it be better, if you always use `` for strings?

  • @infotainment999
    @infotainment999 5 лет назад

    I love the Switch Case example but I hate getting an E on a grade!

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

    Hey Shaun! I was look at the your modern JS course and i notice that all videos you have here from Intro to DOM is the same as first 6 in your full course. Am i right?

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

      Hey, correct :). It’s a free preview of the udemy course. The first 6 chapters.

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

      The Net Ninja thanks for the quick response, as soon as a finish these free tutorials. I will purchase your course
      Thank you

    • @NetNinja
      @NetNinja  5 лет назад

      Thank you so much. Really hope you enjoy it!!

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

    48:47 - Why didn't it show an error? You tried to log the name into console but it only ignores it because it's defined in the inside code block, but then it should pop an error, isn't it?

    • @user-vb2zx1ht9b
      @user-vb2zx1ht9b 4 года назад

      Yes, I also think it should pop an error because the 'name' is not defined

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

    Different consoles give different answers? I'm using the console built into Code, not firefox or chrome. about 48:00 or so where you're teaching the block scope, if I declare "age" in the root and
    let name = 'shaun' ONLY in the first code block, when I
    console.log (age, name); out in the root again (outside of the first code block) I get a "name is not defined" error where you get just a space (or maybe nothing) for the "name" in your console.log.
    Here's my code
    let age = 30;
    if (true) {
    let name = "bob";
    }
    console.log("outside: ", age, name);

  • @Gavrev
    @Gavrev 5 месяцев назад

    That for loop structure in the example at 35:05 is really irritating by not lending itself to visually linear code..

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

    FYI (to noobies), don't try the for loops / while loops with auto save on in vs code (unless you type really fast lol).. even on a decent M1 pro, my Chrome browser crashed and it was so stuck it wouldn't even quit. Had to manually force quit lol.

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

    12:13 I had just run it when you said it XD

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

    20:33
    we can use \'s for apostrophes.
    'that\'s a lot of ninjas'

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

    hy.my question is why in this statement runs the else if? because the last two conditions from else if are not both true.
    const password = 'password';
    if(password.length >= 12 && password.includes('@')){
    console.log('that password is might strong');
    }else if(password.length >= 8 || password.includes('@') && password.length >= 5){
    console.log('that passoword is long enough!');
    }else{
    console.log('password is not strong enough');
    }

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

      The first condition of the else if block (i.e. length >= 8) is true, so the program doesn't check the next two conditions. Change the const value to a shorter sting to make the else block execute.

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

    Love your videos!! , but I had a problem with my Windows 10 pro the browser is not working and I couldn't close it for a while , than when it reached 36,000 ish numbers it closed .
    Man if you just said it faster I would have not been in pain and fear

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

    What shortcut do you use to "//" the whole code?

    • @just_exist_ezz
      @just_exist_ezz 10 месяцев назад

      Its late but still its ctrl + /

    • @agnieszkafojcik4426
      @agnieszkafojcik4426 10 месяцев назад +1

      @@just_exist_ezz thank you so much 🤗 it works!!!

    • @just_exist_ezz
      @just_exist_ezz 10 месяцев назад

      @@agnieszkafojcik4426 no worries how far have you finished the course

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

    44:54 block level scope w/ vars
    scope - area

  • @sankhadipsamanta7708
    @sankhadipsamanta7708 5 лет назад

    Ninjo, when are you starting react native series??

    • @NetNinja
      @NetNinja  5 лет назад +4

      Hey, in 2 or 3 weeks. I'm doing a Firebase hosting & PWA series first :)

    • @sankhadipsamanta7708
      @sankhadipsamanta7708 5 лет назад

      @@NetNinja Ok ninjo, by the way i love your everything. You tell us everything in just few minutes video. Every line you say is important. Also Like your teaching style. Best tutorial to learn technology in less time

    • @rebeka1212100
      @rebeka1212100 5 лет назад

      @@NetNinja 😙👏

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

    what happens in code block stays in the code block.