#11 JavaScript While Loop | JavaScript for Beginners Course

preview_player
Показать описание
In programming, loops are used to repeat a block of code. In this video, we will learn about the while loop.

The while loop in Python is used to iterate over a block of code as long as the test expression (condition) is true. We generally use this loop when we don't know the number of times to iterate beforehand.

Watch the full video to have a clear understanding of the working of JavaScript While Loop.

~

Timestamps:
00:35 While loop syntax
04:45 Creating Multiplication Table
08:31 do While Loop
11:21 Programming Task
11:50 Quiz

Find Programiz elsewhere:

---------------------------------------------------

#11 JavaScript While Loop | JavaScript for Beginners Course

#programiz #javascript #whileloop #JStutorial #while #dowhile #learnprogramming
Рекомендации по теме
Комментарии
Автор

🚀Loved the JS tutorial? Take it further with Programiz PRO!
Refine your skills and build confidence with interactive lessons, quizzes, and challenges. Strengthen your programming foundation and master JavaScript today!

programizstudios
Автор

Sir you are great Your efforts are unbeatable Please keep helping us ❤❤

tiger_gourav
Автор

(Option 4 - All of above) is the correct answer .

In option 1 " while (true) {...} " -> The loop will run for infinite times because the loop has no counter so its always true.
In option 2 "let i =3; while ( i < 4) {....} -> The loop has counter but their is no counter updater so i = 3 will always be i < 4 and so it will create an infinite loop.
In option 3 "let i =3; do { ....} while ( i < 4)" -> Its the same as option 2 only difference is it done using and the "do while" loop.

surjoyday_kt
Автор

Q. Which of the following causes an infinite loop?

1. while (true) {...}

2. let i = 3;
while (i < 4) {...}

3. let i = 3;
do {
...} while(i < 4)

4. All of the above

programizstudios
Автор

All of the above will cause an infinite loop because we don’t know if the values were incremented in the body of the loop.

banjiolawole
Автор

Trying to get user input using prompt but keeps throwing error.
const num1 = parseInt(prompt('Enter the first number '));
Whats could be the issue?

winnieotieno
Автор

Bro your website is not working properly look at data structures course

psg
Автор

All of the above will cause an infinite loop.

racingfan
join shbcf.ru