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...
I'm doing my bootcamp right now and im struggling, but this is super super helpful!
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.
Did you finish your boot camp and are you working
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 🙏
I'm having an IT exam tomorrow and this just saved me!!! thank you so much!!!!!
he wasn't kidding when he said it will go crazy ...
I experienced that and restarted my computer lmao
@@williamalesna5703 I need to try that out fast with R5 2600X
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!
im surprised too i didnt get the error
ur amazing dev
as clear as water, thank you man
Love that intro beat? Is it original or can i find it somewhere? Thanks
I need it too
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.
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
Thankyou bro ...got to understnad the basic os while and for loops
Good video! Can you please tell me the name of the vscode theme? I love
You're the best man!
awesome, would tell me that can we access to Aray by invoking the numbers. Thanks
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.
THANK YOU. THIS IS THE BEST TUTORIAL
Can you make the same tutorial but with document.getElementById?
i need that too
i need that too
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 ?
What was the intro music? Plz lemme know
can you please tell name of song running in background in video starting and ending
You are awesome💗
How can I get the index of the elements using the "of" syntax in the for loop?
it gets false FROM 100, not 101 because the inequality is strict.
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...
What video recorder did you use to make this vid?
obs studio
everyne uses obs
Can you just called the for loop names?, like this:
for (names) {
}
I am dancing every time on the intro song.
same 😁😂
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
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.
wow excellent
"name is deprecated" why does it say that?
Why does
for(name of names){
console.log(name)
}
work but
for(something of names){
console.log(name)
}
doesn't?
@@narayadewe7979 did it work? as i tried some other things and it didnt
@@narayadewe7979 k!
@@capslock3250 yeah this was 2 years ago but i mreading this back now and i dont get why i didnt get that lol
console.log(i didn't find do loop) thank you so much
You don't really need that
Well you forgot the quotes. What a noop programmer
bro so much similarities to python wow
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 ?
You need to start from let loading = 0; then it will make 100 times to stop a loop.
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.
The first you show is a for...of Loop, not a for Loop as the title says.
I WAS THERE POGU
welp, everything went crazy...
Why $()? That part confused me
Refer the Concatenation video
Peace!
who has the name of burrito ? @developedbye? 😂
I blocked my PC twice o|o
why is my ${} not working?!
Use backticks instead of single quotes
Your screen texts are too small to view ☹️ comparing to other RUclipsrs'
Text too small
I ran the code and my PC melted
Good video! Can you please tell me the name of the vscode theme? I love it.