Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Help please.

Can anyone please explain to me what does do{ loop, and while{ loops does. do{

}
and while (){ }

1 Answer

a "while loop" will continue as long as a condition is met, and then break when the condition is no longer true.

a "do While loop" will always run the initial "do" condition once, and then continue to do it as long as the "while" condition is true, when the while condition is no longer true, the loop exits.

I hope this answered your question! :)