Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 99 Bottles Lyrics Practice by Saidur Rahman Setu (@srsetu)
- var n = 99;
- function beer() {
- while( n >= 0) {
- if ( n > 1) {
- console.log(n + " bottles of beer on the wall, " + n + " bottles of beer. Take one down and pass it around, "+ (n - 1) +" bottles of beer on the wall.");
- }
- else if ( n === 1) {
- console.log("1 bottle of beer on the wall, 1 bottle of beer. Take one down and pass it around, no more bottles of beer on the wall.");
- }
- else if (n === 0) {
- console.log("No more bottles of beer on the wall, no more bottles of beer. Go to the store and buy some more, 99 bottles of beer on the wall.");
- }
- n--;
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement