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-...
It's one thing to know coding, It another to know how to teach it. You have it all.
Thanks for the kind words Segun :)
For the very first time in my life, I can say I understand loops
I feel you man i feel you
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.
Fantastic, you really know how to make things entirely new concepts stick in just a few simple sentences.
I watch so manny of your tutorials when i hear your voice it bring me smile ( i am not gay )
Thank you for clarifying that you aren't gay
Well, you are now
@@lewisjones284 HAHHAHAAHHAHAHAHA
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
click lewis jones name to see what he has watched
... drill gay wut the
Thank you for the tutorials. You give such a clear explanation on every topic!
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.
'For loop' explenation was just amazing. Thanks a lot! :)
YES! I've been waiting for this since the last one yesterday!
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!
No problem Han :) glad you enjoyed it!
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!
Thanks for the support and kind words Andy :) means a lot. Glad to help!
I'm straight but this man's voice is one of the reasons this is my preffered channel for dev tutorials
Thanks for you'r tutorials. You always give me a clear explanation .
Get the full course here - www.udemy.com/modern-javascript-from-novice-to-ninja/?couponCode=NINJAYT
again and again, the best online coding tutor ❤
Best JavaScript Tutorial, I bought the full course and it is excellent ! , Arrigato Net Ninja San !
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
That means a lot, thank you :)
The Khan Academy of Coding! You're a legend!
Youre the best teacher I have seen in RUclips. Thank you for the amazing work Shaun
Thanks Rizan, that means a lot :)
Thank you so much for all contents what you share.
Greetings from Brazil!
I like how this guy explains evverything, amazing!
Dude you are already a legend. Helps me so much!
Glad to hear it! :) thanks for watching
This video helped me understand more about Control flow.
Thank you!
Net Ninja and Telusko is my both perfect tutor ✌️✨ The way they explain thing is perfect ✨🎉
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!
You're so welcome! Hope it's helpful :)
You helped me get a good paying job. Thank you.
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!
Controlling the flow is super helpful 🔥 use conditionals evety day.
Well explained and make things clear to beginners, thx!
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.
Now we have a new ninja to play with "chun-li" 😉😉.
Thanks buddy,
Greetings from Tanzania 🇹🇿
You are an excellent Instructor.
Thank you~ Best coding teacher on RUclips. T_T
Helpful tricks to get started with JavaScript journey.
Thanks Shaun your tutorial helped me a lot, you are truly amazing person, God bless you.
Thanks Barkhad! :)
this video helped me to understand the reason why do i need to use let and const instead of var
You're a great teacher, thank you for simplifying these concepts..
Do you have a course on data structures and algorithm?
Thanks a lot, man u get me on the tracks
great series of tutorials. very helpful and informative. thanks
You're very welcome!
Your videos are great! Keep up the great work! :-)
this video has helped me out alot thanks
Thank you so much for this lessons.....you are really a great teacher 🙏🙏
Thank you! 😃 hope you found it helpful
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.
Do scope rules never worked for variables declared with the VAR keyword in, for example, ES5?
Good Tutorial As Always ❤️😎
Thank You very much sir
Subscribed with Joy
Thank you for these helpful videos
Bought the course!!!!! Thanks for making the course.
Thanks so much, hope you enjoy it! :)
The Net Ninja : Yes, it’s really very nice. Thanks for making such fantastic course.
in the variables and block scope lesson, when you console.log the name outside of the block, shouldn't it have been undeclared?
You sir have a loyal subscriber now.
Thank you :)
Very nice!
Can you make full crash course for tenserflow. Js big thanks keep up the good work!
7:41
Ninja: Does that make sense?
Me: No, not really...
Ninja: Cool!
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
You are the best my sifu ! ;)
15:45 or you could just do "while(i
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..?
Hey its just tutorials, no book!
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.
Awesome! Any plans on making vids on CRUD and Dom manipulation?
I think that seeing pink at the start of his videos relaxes my nerves into thinking its easy
Nice! Thanks
hey please could you do a tutorial on data structures and algorithms in javascript? THANK U!!!
hey ninja,can you tell me with waht console.log helps me? i mean,i do not get it
it would great if there is an outline in the description for long videos. thanks
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.?
Easy to understand, perfect💌💌 tutorial #The Net Ninja🤟🤟
🙌 Thank you!!
Hey Shaun! Please make a video on MVC Architecture in JS
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
put your pointer/cursor behind them by using ctrl+LMB and select them all, then delete and write a new word :)
Thank youu!!
Net ninja best of the best
Finally someone explains what a global is without using a buncha jargon that makes no sense
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
try this: for (i = 0; i < 5; i++) ;)
really great course, helped me alot!
excellent
Awesome ! Arigato
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.
Hey Jennifer, the link below has the discount auto applied, hope you enjoy the course :D
www.thenetninja.co.uk/udemy/modern-javascript
thanks alot..
Thanks Mr Ninja🧛♂️
Please, have been trying to download the files from github but i can't access it...any help🙆♂️
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.
48:50 Shaun, I wonder why didn't you get "Uncaught ReferenceError: name is not defined" on line 10
Yeah, that was weird. An explanation might be found here: developer.mozilla.org/en-US/docs/Web/API/Window/name
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
@@maurov2104 right... I forgot that Window.name exists
@@vidyanath16 there's no such thing. It's actually because window has "name" property
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?)
you have console.log(scores[i]); before the code block checking for zero
@@bonniethuku241 Thanks for you help!)
Hi !! Shaun Please tell me the discount on this javascript udemy course i wanna buy it Right now
It would be cool if you could create another gigantic course on Udemy, which covers all topics on modern CSS and HTML
Owoaahhhhhhhh
Dude,
Your tutorial is awesome !!!
JavaScript is no longer tough !!!
Keep adding KUNG FU VIDEOS !!!
Please post the other part of the course also from udemy !
The main benefit of scope is to avoid naming conflict.
Wouldn't it be better, if you always use `` for strings?
I love the Switch Case example but I hate getting an E on a grade!
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?
Hey, correct :). It’s a free preview of the udemy course. The first 6 chapters.
The Net Ninja thanks for the quick response, as soon as a finish these free tutorials. I will purchase your course
Thank you
Thank you so much. Really hope you enjoy it!!
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?
Yes, I also think it should pop an error because the 'name' is not defined
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);
That for loop structure in the example at 35:05 is really irritating by not lending itself to visually linear code..
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.
12:13 I had just run it when you said it XD
20:33
we can use \'s for apostrophes.
'that\'s a lot of ninjas'
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');
}
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.
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
What shortcut do you use to "//" the whole code?
Its late but still its ctrl + /
@@just_exist_ezz thank you so much 🤗 it works!!!
@@agnieszkafojcik4426 no worries how far have you finished the course
44:54 block level scope w/ vars
scope - area
Ninjo, when are you starting react native series??
Hey, in 2 or 3 weeks. I'm doing a Firebase hosting & PWA series first :)
@@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
@@NetNinja 😙👏
what happens in code block stays in the code block.