Last active
August 19, 2017 19:05
-
-
Save ceci21/f29f58995a8eee0a631d59a9420dc1d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function displayBeers() { | |
var counter = 99; | |
return function() { | |
if (counter === 0) { | |
console.log("No more!"); | |
} | |
console.log(counter + " bottles of beer on the wall\n" + counter + " bottles of beer\nTake one down and pass it around\n" + (counter - 1) + " bottles of beer on the wall\n"); | |
counter = counter - 1; | |
} | |
} | |
var beerVerse = displayBeers(); | |
beerVerse() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment