Yo Ninjas, in this JavaScript tutorial I’ll be introducing the concept of looping in JS. More specifically, we’ll be taking a look at the while loop – the most basic form of loops.
JavaScript loops are a way of repeating sections of code over and over, so that you’re not having to re-write code again and again manually. For as long as a specified condition is true, the loop will continue to execute your code.
Be careful not to cause an infinite loop! This can crash your computer.
As always, any questions, fire away :).
SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1
========== JavaScript for Beginners Playlist ==========
========== CSS for Beginners Playlist ==========
========== HTML for Beginners Playlist ==========
========== The Net Ninja ============
For more front-end development tutorials & to black-belt your coding skills, head over to – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk
========== Social Links ==========
Twitter – @TheNetNinja – https://twitter.com/thenetninjauk
Original source
14 responses to “JavaScript Tutorial For Beginners #16 – While Loops”
can you please tell how you run the code in chrome?
1:22 That will crush your coumputer…so, I'll show you that in a second. 😀
Great videos, though! Thanks!
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.
Great tutorial – thanks for sharing!
Northern accents are oddly appropriate for voices of authority (I'm southern).
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!
I am so happy I can cry right now.
age++, the key that I was missing.
I never realised that with (i=0; i<10; i++)
You can do it with other variables.
It's so simple.
The Net Ninja what text editor you using??
wow you solved my frustration! thanks! I've been stuck on the while loop for a while. great video!
Clear and concise as always. Your videos are the best.
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
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.
var thx = true;
while (thx === true && thx !== false) {
document.write ("very helpful, best tuts thnxx");
}
Thanks! it really was helpful!