[JS]beer code for while and if-else practise.
[JS]refine beer code