JSFiddle - React, Tailwind, and code Playground

by akang2

JavaScript

//Create the 99 bottles of beer on the wall game. 

//create a var for the bottles

//create a loop that decremements the # of bottles

//console log the number of bottles each time they are decremented

//don't forget to concatenate the var with the string sentence " bottles of beer on the wall"

//the var for bottles of beer
var bottles = 99;

//the loop for decrementing the bottles
while(bottles > 0) {
    //this is printing out the # of bottles we got so far
    console.log(bottles + " of beer on the wall!");
    //this is decrementing the # of bottles before the loop starts again
    bottles--;
}