While and Do…While Loops

Video

JavaScript Notes

JavaScript
    // while (condition) {
    // statements
    // }
    //
    // do {
    // statements
    // } while (condition) let total = 0;
    while (total < 30) {
    total += Math.floor(Math.random() * 5) + 1;
    }

    do {
    total += Math.floor(Math.random() * 5) + 1;
    } while (total < 30)