js: beer-song: replace loop with map

i couldn't resist any longer