Advertisement
Guest User

beers

a guest
Jan 27th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. if(beers < 1)
  2. return null;
  3. console.log('[js] bottles (' + beers +')');
  4. let res = "";
  5.  
  6. for(var i = beers; i > 1; i--) {
  7. res = res.concat(`${i} bottles of beer on the wall, ${i}\
  8. bottles of beer.<br/>Take one down and pass it around, ${i}\
  9. bottles of beer on the wall.<br/><br/>`);
  10. }
  11. res = res.concat(`1 bottle of beer on the wall, 1\
  12. bottle of beer.<br/>Take one down and pass it around, 1\
  13. bottle of beer on the wall.<br/><br/>\
  14. No more bottles of beer on the wall, no more bottles of beer.<br/>\
  15. Go to the store and buy some more, ${beers} \
  16. bottles of beer on the wall.`);
  17. return res;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement