Guys Please i need a simplified explanation of a while loop
3/10/2021 3:07:21 PM
Kwabena Karikari Affum23 Answers
New AnswerHi! This topic is covered in Lesson 19.1 of your JavaScript course. please be diligent
Unlike do-while loop, while loop will enter the body only if condition is satisfied and performs increment operation inside the loop body unlike for loop. While loop will repeat itself until the condition becomes false.
Kwabena Karikari Affum the easiest way to learn is by examples. As Gordon and Ярослав Вернигора(Yaroslav Vernigora) mentioned. in my example: while ( condition ) { do this until condition is met; } while ( True ) { do this until condition is met; } while ( False ) { do this until condition is met; }
If the condition is true it goes to next statement. When it becomes false then it Reactedley check the condition
please provide a sample code that you don't understand with this loop or something else... otherwise, go learn your course from the very beginning and ask only in substance, with concrete examples. no abstract explanations will help you until you try and feel it yourself
well, sometimes we just some work till a certain condition is met, for example > i will watch telivision for 1 hr .. It just means you will watch tv until 1hr is passed ... so ,tv is in our loop ...like this while(not 1hr passed) { watch TV } as 1hr passed you can see ( not 1hr passed) become false ,as 1hr is passed... it just means, you won't be watching tv now OR JUST end THE LOOP STUFF...
Actually I'm learning while loop at mimo I just want to be at for loop in mimo and at the same time at sololearn
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message